Wilang Documentation1.0.0+4

Logic, predicates and sets#

Booleans and conditionals#

Compare with ==, !=, <, <=, >, and >=. Combine with and, or, xor, and not. Choose a result with condition ? yes : no.

Example
(3 > 1) and (3 < 5)
not false
true ? 10 : 20

The named comparison functions such as equal, larger, and smallerEq are the function form of the same operators, and deepEqual compares nested contents. Given an array, a comparison may return an array of booleans rather than one boolean.

Predicates and special values#

isFinite, isNaN, isInteger, isNumeric, isNegative, isPositive, isZero, and hasNumericValue test values. Test NaN with isNaN, never with equality. nullish supplies an alternative for a null or undefined result.

Sets#

The set functions cover union, intersection, difference, symmetric difference, the Cartesian product, distinct values, size, multiplicity, subset tests, and the powerset. They take the array and matrix shapes listed in each reference.

Example
setUnion([1, 2, 3, 4], [3, 4, 5, 6])

The bitwise functions (bitAnd and friends) operate on integer bits, which is a different thing from boolean logic.

All functions