Bitwise operators convert both operands to 32 bit integers and apply the operator to them on a bit-by-bit basis.
Here is a table of all operators in the bitwise category and those that are members of other categories but perform bitwise operations:
|~||Bitwise complement (NOT)|
|<<||Bitwise left shift|
|>>||Bitwise right shift|
|>>>||Bitwise right shift (unsigned)|
||||Bitwise inclusive OR|
|^||Bitwise XOR (exclusive OR)|
|&=||Bitwise AND and assign to an LValue|
||=||Bitwise inclusive OR and assign to an LValue|
|^=||Bitwise exclusive XOR and assign to an LValue|
|<<=||Bitwise shift left and assign to an LValue|
|>>=||Bitwise shift right and assign to an LValue|
|>>>=||Bitwise shift right (unsigned) and assign to an LValue|
The result of a bitwise expression is a 32 bit binary value and should not be confused with the Boolean value returned by a logical operator.
Be careful to use the correct number of ampersands and vertical bars to select the bitwise of the operator. Refer to the Logical operator topic for a list of operators to avoid in bitwise expressions.
|See also:||Associativity, Binary bitwise operator, Bit-field, Bitwise AND (&), Bitwise AND then assign (&=), Bitwise OR then assign (|=), Bitwise shift left then assign (<<=), Bitwise shift right and assign (>>=), Bitwise unsigned shift right and assign (>>>=), Bitwise XOR and assign (^=), Logical operator, Operator, Operator Precedence, Type conversion|
ECMA 262 edition 2 - section - 11.10
ECMA 262 edition 3 - section - 11.10