According to the MDN:
Bit-to-bit operators are operators treated as 32 sequence
bits ( zeros and ones ), preferably as decimal, hexadecimal, or
octal numbers. For example, the decimal number 9 had as
1001 binary representation. Bit-to-bit operators perform
operations on such binary representations, but return values
numeric in the Javascript pattern
.
console.log(5 & 13); // 0101 & 1101 = 0101
// expected output: 5;
console.log(parseInt("0101",2) & parseInt("1101",2));
// expected output: 5;
console.log(5 & 13 & 3); // 0101 & 1101 & 0011 = 0001
// expected output: 1;
console.log(5 | 13); // 0101 | 1101 = 1101
// expected output: 13
....Operator...... Use......... Description
Bitwise AND........ a & b... Returns 1 at each bit position for which the
......................................... corresponding bit of both were 1s.
Source: Bitwise Operators