What Are Bitwise Operators?
Bitwise operators work at the binary level, meaning they perform operations on the bits of numbers rather than their decimal values. JavaScript converts numbers to 32-bit signed integers before applying bitwise operations.
Common Bitwise Operators
AND (&) - Returns 1 if both bits are 1.
OR (|) - Returns 1 if at least one bit is 1.
XOR (^) - Returns 1 if the bits are different.
NOT (~) - Inverts all bits (one's complement).
Left Shift (<<) - Shifts bits left, filling with 0s.
Right Shift (>>) - Shifts bits right, keeping the sign.
Zero-Fill Right Shift (>>>) - Shifts right, filling with 0s.