Policies & Guidelines

WITH_ITEM

Add item to array

Description

Returns new array which contains the given item at the end of the array. The item must match the schema of the array.

Function signature

WITH_ITEM(array: Array, item: ) => Array

Parameter

Description

Array

Array to add item to

Item

Item to add

Examples

numbers = [100,3,20]
animals = ["cat","dog"]
empty = []

Formula

Return value

WITH_ITEM(numbers, 4)

[100,3,20,4]

WITH_ITEM(animals, "pig")

["cat","dog","pig"]

WITH_ITEM(empty, 4)

[4]