Array

Array methods and properties.

Description

Array methods are provided for working with multiple items grouped under a single identifier.

Arrays are immutable.

Static methods

Method Description

Create an ordered Array of integers, given start and end values.

Instance properties

Property Description

Get the length of an Array.

Instance methods

Method Description

Aggregate all elements of an Array.

Test if any element of an Array matches a provided predicate.

Append a provided element to an Array.

Get the Array element at a provided index.

Concatenate two Arrays.

Get the unique elements of an Array.

Drop the first N elements of an Array.

Add the index to each element of an Array.

Test if every element of an Array matches a provided predicate.

Filter an Array using a provided predicate.

Get the first element of an Array.

Get the first element of an Array that matches a provided predicate.

Apply a provided function to each Array element and flatten the resulting Array by one level.

Flatten an Array by one level.

Reduce the Array to a single, accumulated value by applying a provided function to each element. Iterates through elements from left to right. Uses a provided seed as the initial value.

Reduce an Array to a single, accumulated value by applying a provided function to each element. Iterates through elements from right to left. Uses a provided seed as the initial value.

Run a provided function on each element of an Array. Can perform writes.

Test if the Array includes a provided element.

Get the index of the first Array element that matches a provided value.

Get the index of the first Array element that matches a provided predicate.

Test if an Array is empty.

Get the last element of an Array.

Get the index of the first Array element that matches a provided value.

Get the last element of an Array that matches a provided predicate.

Get the last element value that matches the given predicate.

Apply a provided function to each element of an Array. Can’t perform writes.

Test if an Array is not empty.

Sort an Array's elements.

Prepend an element to an Array.

Reduce an Array to a single, accumulated value by applying a provided function to each element. Iterates through elements from left to right. Uses the first element as the initial value.

Reduce an Array to a single, accumulated value by applying a provided function to each element. Iterates through elements from right to left. Uses the first element as the initial value.

Reverse the order of an Array's elements.

Get a subset of an Array's elements based on provided indexes.

Get the first N elements of an Array.

Convert an Array to an Set.

Convert an Array to a String.

Get the elements of an Array that match a provided predicate.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!