Operators
Bitwise or (|)
Sets bits that are set in either operand. Number operands become 32-bit signed integers. Both operands are evaluated, unlike logical OR.
Formal Syntax & Structure
javascript syntaxjavascript
left | rightParameters & Attributes
| Name | Type | Description |
|---|---|---|
| left | expression | Left operand. |
| right | expression | Right operand; short-circuiting may skip evaluation where applicable. |
Return Value
Number or BigInt
Result of the operation.
Working Example
Example Snippetjavascript
console.log(4 | 1);