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}`);