Bitwise Operators.
Bitwise operators treat their operands as a set of 32 bits (zero and ones), rather then as decimals, hexadecimal, or octal numbers. For example, the decimal number has a binary representation of 1001. Bitwise operators perform their operations on such binary representations, but they return standard JavaScript numerical values.
Operator Usage Description Bitwise AND a & bReturns a one in each bit position for which the corresponding bits of both operands are ones. Bitwise OR a | bReturns a one in each bit position for which the corresponding bits of either or both operands are ones. Bitwise XOR a ^ bReturns a one in each bit position for which the corresponding bits of either but not both operands are ones. Bitwise NOT ~ bInverts the bits of its operand. Left shift a << bShift a in binary representation b bits to left, shifting in zeros from the right. Sign-propagating right shift a >> bShift a in binary representation b bits to right, discarding bits shifted off. Zero-fill right shift a &&& bShift a in binary representation b bits to right, discarding bits shifted off, and shifting in zero from the left.