ArrayEdit on GitHub
Utilities for working with arrays.
Returns the length of the input array.
make(n, value) creates a new array of length
n filled with
make, but each array value is initialized with the result of subsequent calls to the given initializer function. The initializer is called with the index of each array slot.
An alias for normal syntactic array access, i.e.
Array.get(n, array) retrieves the
nth item from the array. A negative
n is treated as an offset from the end of the array.
An alias for normal syntactic array set, i.e.
array[n] := value.
Array.set(n, value, array) sets the
nth slot in the array to
value. A negative
n is treated as an offset from the end of the array. Returns the newly set item.
Array.append(array1, array2) creates a new array with the items of
array1 followed by the items of
array2. This does not modify
Takes a list of arrays and creates a single array containing the elements of all of the arrays. Does not modify any of the input arrays.
Produces a copy of the input array.
Array.forEach(fn, array) calls
fn on each element of the array.
Array.forEachi(fn, array) calls
fn on each element of the array, along with the index of the element.
Array.map(fn, array) produces a new array by calling
fn on each element of the input array.
Array.mapi(fn, array) produces a new array by calling
fn on each element of the input array along with its index.
Converts the input array to a list.
Converts the input list to an array.
Checks if the item is an element of the input array. Uses the generic
== structural equality operator.