Checks whether the bit at the specified position in a number is set (1).
true if the bit at position k is 1, otherwise false.
true
k
false
isBitOn(0b1010, 1); // → true (bit 1 is set)isBitOn(0b1010, 0); // → false (bit 0 is clear)
The number to check.
Zero-based bit position to check (0 = least-significant bit).
Generated using TypeDoc
Checks whether the bit at the specified position in a number is set (1).
Returns
trueif the bit at positionkis 1, otherwisefalse.Example
Remarks