Bitwise Operators
AND, OR, XOR, NOT, and shifts.
Down to the Bits
Every integer is really a row of bits. Bitwise operators let you work on those individual ones and zeros directly, with no rounding or math in between.
Bitwise AND
The & operator keeps a bit only where both inputs have a 1. It is the classic tool for masking off the bits you do not want.
const masked = value & 0x0F;