WITH_ITEM

Add item to list

Description

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

Function signature

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

Parameter

Description

List

List 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]