or()

Performs a bitwise OR operation on one or more integers.

Syntax

or(value1, [value2, ...])

Parameters

Parameter Type Description
value1 Number The first integer value.
value2..N Number Additional integer values to apply OR with. optional

Return Value

Examples

Single value, returns itself

or(5);      // returns 5

Bitwise OR of 5 (0101) and 3 (0011) → 0111

or(5, 3);   // returns 7

Bitwise OR of 1 (0001), 2 (0010), and 4 (0100) → 0111

or(1, 2, 4); // returns 7

See also

bit
not
and
or
xor
nand
nor
xnor
shl
shr