append() Function

Function

append( array, value )

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

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.

Parameters

Keyword Type Description

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

Usage considerations

Only the first value parameter is required.

Examples

You can experiment with this function in the test box below.

Test Input

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

Open in Github Built: Tue, Nov 23, 2021 (07:31:45 PM)

On This Page

FEEDBACK