JavaScript Bitwise OR Operator



Bitwise OR Operator

| symbol is used for Bitwise OR operator.

Bitwise OR operator takes two values/variables as operands, performs OR logic gate operation at bit level, and returns their result.

a | b
6 | 74

Examples

1. Bitwise OR of values in a, b.

a = 7;
b = 14;
output = a | b;
console.log(`${a} | ${b} = ${output}`);