Bitwise operators JavaScript
Bitwise operators work on the bit-level. In JavaScript, a set of 32-bit binary digits (zeros and ones) perform actions on the bit-level. However, the result is shown as a decimal value.
JavaScipt bitwise operators:
Operators | Name | Example |
---|---|---|
& |
Bitwise AND | x & y |
| |
Bitwise OR | x | y |
^ |
Bitwise XOR | x ^ y |
~ |
Bitwise NOT | ~x |
<< |
Left shift | x << y |
>> |
Sign-propagating right shift | x >> y |
>>> |
Zero-fill right shift | x >>> y |