Is there a way in JavaScript to determine if a single Bit is On (1) or Off (0)?
function isBitOn(number, index)
{
// ... ?
}
// Example:
let num = 13; // 1101
isBitOn(num, 0); // true 1
isBitOn(num, 1); // false 0
isBitOn(num, 2); // true 1
isBitOn(num, 3); // true 1
I'm familiar with Bitwise Operations in JavaScript. How can these operations be used, or are there other methods available to check a single Bit?