len
The number of items in an array or list, characters in text, or entries in a map.
xs(array) -- an array or list
The number of items in an array or list, characters in text, or entries in a map.
xs (array) -- an array or listAdds an item to the end. Given a name, the array itself grows (like xs.append(v)); a non-number item turns a number array into a list.
xs (array) -- an array or listitem (any) -- the item to addA new array or list: the first followed by the second.
xs (array) -- firstys (array) -- secondA new array or list in reverse order. (On a linked list, reverse animates the in-place reversal -- see Data Structures.)
xs (array) -- an array or listA new array sorted from smallest to largest, compared exactly (sqrt(2) sorts after 1.4142). Quantities sort by their value in one unit (250 mN before 3 N).
xs (array) -- an array of numbersWhether an array or list has an item equal to the value, text contains a piece of text, or a map has a key. (On a set, set membership -- see Sets.)
xs (array) -- an array or listitem (any) -- the value to look forThe position (from 0) of the first item equal to the value, or -1 if there is none.
xs (array) -- an array or listitem (any) -- the value to look forA map's keys in the order they were added (a record's field names).
m (map) -- a map or recordA map's values in the order their keys were added.
m (map) -- a map or recordWhether a map has the key.
m (map) -- a map or recordkey (any) -- text, a number or true/falseRemoves a key (and its value) from a map, and shows the map.
m (map) -- a mapkey (any) -- the key to removeThe items of an array or list for which a condition holds, in their order. The item is called x in the condition, or the name given third. The same as xs[condition], e.g. xs[xs > 20].
xs (array) -- an array or listcondition (expression) -- a condition on the item, e.g. x > 20name (name) -- optional: the item's name in the condition (default x)How many items of a collection satisfy a condition, or how many tuples, orderings or subsets of its items do. countWhere(xs, condition) counts the items as filter selects them (the item called x, or the name given third); xs may be a whole number n for the numbers 1..n. countWhere(xs, fn(x, y) condition) counts the ordered pairs (triples, ... : one entry per parameter of the function; an item may repeat) for which the function holds; a third argument "distinct" allows no repeated item (the k-permutations), "sets" counts the subsets of that many items (each once, in the list's order), and "permutations" tests every ordering of the whole list, given to a function of one parameter as a list (up to 9 items). Up to a million tuples; the count is exact. For an unordered pair with repeats count sets and singles separately. relationWhere(A, B, rule, x, y) lists the pairs instead of counting them.
xs (array) -- an array or list, or a whole number n for 1..ncondition (expression) -- a condition on the item (x, or the name given third), or an anonymous function fn(x, y) ... of as many parameters as the tuple has entriesmode (string) -- optional: with a function, "tuples" (default: entries may repeat), "distinct", "sets" or "permutations"; with a condition, the item's name (default x)Every ordering of the items of a list, as a list of lists (n! of them: up to 9 items). xs may be a whole number n for 1..n. filter and countWhere take the result; countWhere(xs, fn(p) ..., "permutations") counts without listing.
xs (array) -- an array or list, or a whole number n for 1..nEvery ordered k-tuple of the items of a list, an item allowed to repeat, as a list of lists (n^k of them, up to a million). xs may be a whole number n for 1..n.
xs (array) -- an array or list, or a whole number n for 1..nk (integer) -- the entries in each tupleEvery subset of k items of a list, each in the list's order, as a list of lists (nCr(n, k) of them, up to a million). xs may be a whole number n for 1..n. powerSet gives the subsets of every size.
xs (array) -- an array or list, or a whole number n for 1..nk (integer) -- the items in each subsetThe items from position i up to (not including) j, as xs[i:j]; without j, to the end. Positions count from 0; a negative one counts from the end. Text is sliced by character.
xs (array) -- an array, list or texti (integer) -- the first positionj (integer) -- optional: the position to stop before