• It’s byte by byte
let a = 5;      / / 00000000000000000000000000000101
a |= 3;         / / 00000000000000000000000000000011
console.log(a); / / 00000000000000000000000000000111
Copy the code
let a = 5;      / / 00000000000000000000000000000101
a |= 4;         / / 00000000000000000000000000000100
console.log(a); / / 00000000000000000000000000000101
Copy the code