or

x or y

or(x, y)

Try it yourself:

See also:

or: combine logical conditions

or(a, b) is true when at least one condition is true. It expresses alternatives such as “the value is missing or negative” in a readable rule.

Truth-table idea

Only false OR false is false. All other combinations are true. This is logical OR, distinct from bitOr(), which combines integer bits.

Build validation rules

Combine it with and, not, and equal. Predicates such as isNegative() and isZero() make conditions clear.

Caveat

Use parentheses in longer expressions so that the intended precedence is obvious, especially when AND and OR are mixed.

All functions