TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
| (Bitwise OR) operator performs a logical OR operation on each pair of corresponding bits of its operands. Depending on the operand types, it evaluates them either as 32-bit signed integers (for Number values) or as arbitrary-precision integers (for BigInt values), returning a new value of the matching type where each bit is set to 1 if at least one of the corresponding bits in the operands is 1.
Syntax
Execution Mechanics
- Type Evaluation and Coercion:
NumberOperands: If the operands are standard numbers (or non-BigIntvalues coercible to numbers), JavaScript passes them through the internalToInt32abstract operation.- Fractional values are strictly truncated (the decimal portion is discarded).
- Non-numeric values are coerced to numbers. Values that resolve to
NaN,null, orundefinedare converted to0. - Numeric values exceeding the 32-bit signed integer limit wrap around.
BigIntOperands: If both operands areBigIntvalues, they are evaluated as arbitrary-precision integers using two’s complement representation. They bypassToInt32entirely and are not truncated to 32 bits.- Mixed Types: Attempting to apply the operator to a mix of
BigIntandNumberoperands throws aTypeError.
- Bitwise Alignment: The JavaScript engine aligns the binary representations of both integers. For
Numberoperands, this is strictly bounded to 32 bits. ForBigIntoperands, the representation conceptually extends with infinite sign bits to accommodate the magnitude of the values. - Evaluation: A logical OR is applied to each bit position according to the following truth table:
0 | 0yields00 | 1yields11 | 0yields11 | 1yields1
Code Visualization
Standard Number EvaluationNumber only)
Master JavaScript with Deep Grasping Methodology!Learn More





