Values
Contains
a.Contains(b) -> boolean
Returns true if the a contains the given b.
- If
ais an Array, returns true ifbis an element of the Array. - If
ais a Map, returns true ifbis a value in the Map. - If
ais a Range, returns true ifbis a number within the Range. - If
ais a Category, returns true ifbis a subset or equal toa. - If
ais a Flag, returns true ifbis a subset or equal toa. - If
ais a String, returns true ifbis a substring ofa.
In all other cases, returns false.
CountBits
x.CountBits -> number
CountBits(x) -> number
Returns the number of bits set in the input.
The input must be a Flag or Category,
unless it is nullish, in which case this function returns undefined.
IsEmpty
x.IsEmpty -> boolean
IsEmpty(x) -> boolean
Returns true if the value is empty, false otherwise.
A value is empty if it is:
nullorundefinedfalse0@(0,0)- a String of length 0
- an Array, Map or Range with no elements
Length
x.Length -> value
Length(x) -> value
Returns the length of x.
- If
xis a V2, returns the length of the vector. - If
xis an Array, returns the number of elements. - If
xis a Map, returns the number of key-value pairs. - If
xis a Range, returns the number of steps in the range. - If
xis a String, returns the number of characters. Note that this requires iterating through the string as characters are stored as UTF-8, and so the time taken for this calculation is proportional to the length of the string. - Otherwise, returns
undefined.
OrDefault
x.OrDefault(default) -> value
Returns the first argument if it is not undefined, otherwise returns the second argument.
Overlaps
a.Overlaps(b) -> boolean
Returns true if the a and b have any elements in common.
- If
aandbare both Categories, returnstrueif they have any categories in common. - If
aandbare both Flags, returnstrueif they have any values in common. - Otherwise, returns
false.