In ruby, what does the |= operator do?
|=
Example:
a = 23 a |= 3333 # => 3351
The only vertical bar is the bitwise OR operator.
a |= 3333 equivalent to a = a | 3333 a = a | 3333
a |= 3333
a = a | 3333
|= called syntactic sugar.
In Ruby, a = a | 3333 a = a | 3333 same as a |= 3333 .
| means
|
The binary OR operator copies a bit if it exists in any of the operands. Bitwise Bitwise Operators
Source: https://habr.com/ru/post/1490880/More articles:Using JAW-XS annotations in Tomcat / Axis2 - javaDoes the remainder support arraialist objects? - javaCollection Initialization - javaXML parsing with Jsoup - javaHow to get a prepared request that is sent to db - pythonVisual Studio 2012 automatically creates a virtual directory in IIS 7 at startup - iis-7Getting numbers calculated using formulas using XLConnect - rMeteor http get call - javascriptScrolling to delete a list shows artifacts - androidRunning agi script if call doesn't answer? - asteriskAll Articles