Skip to main content

Description

Performs a bitwise OR operation on two integers. Each bit in the result is 1 if at least one of the corresponding bits in the operands is 1.

Syntax

Parameters

Returns

Type: number (integer) The result of the bitwise OR operation.

Examples

Example 1: Basic OR Operation

Output:
(Binary: 1100 OR 1010 = 1110 = 14)

Example 2: Combining Permission Flags

Output:
(Binary: 01 OR 10 = 11 = 3)

Example 3: Setting Multiple Flags

Notes

  • Operates on 32-bit signed integers in JavaScript
  • Both operands are converted to integers if needed
  • Commonly used for combining flags and setting bits

See Also

Frequently Asked Questions

It returns an integer where each bit is 1 if the corresponding bit in either (or both) input operands is 1. For example, flex.bitwise.or(5, 3) returns 7.
Use flex.bitwise.or(existingFlags, newFlag) to add a permission bit. For example, flex.bitwise.or(permissions, 4) sets the third bit.