Skip to main content
Version: edge


The array module contains functions to work for arrays.



Returns the array for null values removed.

array::coalesce([1, null, 2, null, 3]) = [1, 2, 3]

Returns an array.

concatenate(left, right)

Concatenates two arrays returning a new array. The new array is not a set, i.e. it can contain duplicates depending on the input arrays.

array::concatenate([1, 2, 3], [3, 4]) == [1, 2, 3, 3, 4]

Returns an array

contains(array, element)

Returns if array contains an element.

Returns an bool.


Flattens a nested array recursively.

array::flatten([[1, 2, 3], ["a", "b", "c"]]) = [1, 2, 3, "a", "b", "c"]

Returns an array.


Returns if array is empty.

Returns an bool.

join(array, string)

Joins the elements of an array (turing them into Strings) for a given separator.

array:join(["this", "is", "a", "cake"], " ") => "this is a cake"

Returns a string.


Returns the length of array.

Returns an integer.

push(array, element)

Adds an element to the end of array.

Returns an array.


Reverses an array

array::reverse([3, 2, 3, 1, 4]) == [4, 1, 3, 2, 3]

Returns an array


Sorts an array

array::sort([3, 2, 3, 1, 4]) == [1, 2, 3, 3, 4]

Returns an array


Unzips an array of tuples into an array of two arrays.

Note: array's elements need to be arrays of two elements.

array::unzip([[1, "a"], [2, "b"], [3, "c"]]) ==  [[1, 2, 3], ["a", "b", "c"]]

Returns an array.

zip(left, right)

Zips two arrays, returning a new array of tuples for the first element being part of the left array and the second element part of the right array.

Note: left and right need to have the same length.

let left = [1, 2, 3];
let right = ["a", "b", "c"];
array::zip(left, right) == [[1, "a"], [2, "b"], [3, "c"]]

Returns an array.