Name

| — NN 2 IE J1 ECMA 1

Synopsis

The bitwise OR operator. This operator performs binary math on two operands (their binary values). Each column of bits is subjected to the Boolean OR operation. If the value of a column in both operands is 0, the result for that column position is 0. All other combinations yield a 1. The resulting value of the operator is the decimal equivalent of the binary result. For example, the binary values of 3 and 6 are 0011 and 0110, respectively. After an OR operation on these two values, the binary result is 0111; the decimal equivalent is 7.

Example

var n = 3 | 6

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.