JavaScript has seven bitwise operators. The term bitwise here means to operate on binary numbers. These operators are rarely utilized but are useful to know about nonetheless:
- Bitwise unsigned right-shift operator: >>>
- Bitwise left-shift operator: <<
- Bitwise right-shift operator: >>
- Bitwise OR: |
- Bitwise AND: &
- Bitwise XOR: ^
- Bitwise NOT: ~ (a unary operator)
All bitwise operators in JavaScript will first coerce their operands (or a singular operand, ...