append() Function

Appends a value or values to the given array, and returns the resulting array.

Syntax

append( array, value, … )

array: (Any Type Array) The array to modify.

value: (Any Type or Any Type Array) The value or values to append.

Returns

Any Type Array

Notes

Only the first value parameter is required.

Examples

Append one item to an array:

append({10, 20, 30, 40}, 50) returns 10, 20, 30, 40, 50

Append an array to an empty array:

append({}, {60, 70}) returns 60, 70

Append one array to another:

append({10, 20, 30, 40}, {50, 60, 70}) returns 10, 20, 30, 40, 50, 60, 70

Append multiple arrays to an original array:

append({"Red", "Green"}, {"Blue", "Yellow"}, {"Brown", "White"}) returns Red, Green, Blue, Yellow, Brown, White

See Also

insert(): Use this function to add items to the beginning or middle of an array.

joinarray(): Use this function to insert a string element between each item in the resulting array.

Open in Github Built: Fri, Nov 04, 2022 (07:10:52 PM)

On This Page

FEEDBACK