mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
1023 B
1023 B
Function and
Logical and. Test whether two values are both defined with a nonzero/nonempty value.
Syntax
math.and(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 both inputs are defined with a nonzero/nonempty value. |
Examples
math.and(2, 4); // returns true
a = [2, 5, 1];
b = [2, 7, 1];
c = 0;
math.and(a, b); // returns true
math.and(a, c); // returns false