Array

Array Push

Add an newItem to the end of an array.

Expression:

ARR_PUSH(stack: array[], newItem: any)

Return:

array[]

Example of usage:

ARR_PUSH(["apples","pears"], "oranges")

Return value:
["apples","pears","oranges"]

Array Splice

Trim an array of elements bordered by indexes; optionally, can add new elements.

Expression:

ARR_SPLICE(stack: array[], index: number, deleteCount: number, newItems?: any)

Return:

array[]

Example of usage:

Array Sum

Returns a sum of all numeric values of Array elements.

Expression:

ARR_SUM(stack: array[])

Return:

float

Example of usage:

Array Map

Returns second argument (as an expression) for each array element.

Variables item, index are available in the expression, representing listed item.

Expression:

ARR_MAP(stack: array[], filter: expression)

Return:

array[]

Example of usage:

Array Filter

Return matched array pattern in comparison with the second expression argument.

Variables item, index are available in the expression, representing listed item.

Expression:

ARR_FILTER(stack: array[], filter: expression => boolean)

Return:

array[]

Example of usage:

Array Reduce

Reduces provided array by calling a second argument (as an expression).

Variable 'previousValue', 'currentValue' and 'currentIndex' are available in an expression.

Expression:

ARR_REDUCE(stack: array, {previousValue || currentValue || currentIndex})

Return:

float

Example of usage:

Array Find

Returns array of indexes for which the expression returns true.

Variable 'item' and 'index' are available in the expression.

Expression:

ARR_FIND(stack: array, filter: expression)

Return:

array[]

Example of usage:

Includes

Returns true if an item is included in an array.

Expression:

INCLUDES(array: any, item: any)

Return:

boolean

Example of usage:

Last updated

Was this helpful?