bitmask
A number used as a row of on/off switches, where each binary digit (bit) stands for one flag.
In more detail
Bitwise operators combine and test flags quickly: | adds a flag, & ~flag removes it, and x & -x keeps only the lowest set bit. Many flags fit in one number and can be compared in a single operation.
Examples
React stores pending update priorities as a lanes bitmask: pending |= SyncLane.const SyncLane = 0b0001; pending |= SyncLane;Related terms
- lane — The internal React label for the priority of an update, stored as one bit in a number so many priorities can be combined and compared quickly.
Taught in
- Concurrent Mode: Interruptible Work And Lane Priority — React 19 & Modern Component Architecture