JavaScript › Numbers, Math & BigInt
How do bitwise operators like >>>, &, and | behave differently on BigInt versus Number?
AdvancedAnswer
Most bitwise operators work on BigInt the same way conceptually (treating it as an arbitrary-precision two's-complement integer), EXCEPT the unsigned right shift (>>>), which is explicitly NOT supported on BigInt at all, since BigInt has no fixed bit-width to define an 'unsigned' representation against.
5n & 3n; // 1n -- works fine
5n | 2n; // 7n -- works fine
// (-5n) >>> 1n; // TypeError: BigInts have no unsigned right shiftReal-world example Implementing custom arbitrary-precision bit-manipulation logic, like a big-integer hashing algorithm.