1014 B

Function or

Logical or. Test if at least one value is defined with a nonzero/nonempty value.

Syntax

math.or(x, y)

Parameters

Parameter Type Description
x Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | null | undefined First value to check
y Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | null | undefined Second value to check

Returns

Type Description
Boolean Returns true when one of the inputs is defined with a nonzero/nonempty value.

Examples

math.or(2, 4);   // returns true

a = [2, 5, 1];
b = [];
c = 0;

math.or(a, b);   // returns true
math.or(b, c);   // returns false

See also

and, not