Click or drag to resize

array.add Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
array.add Function

The array.add function appends an item to the tail of a specified array.

Syntax

Alchemy
array.add(ident, expr);

Nomenclature

identRequired. The array
exprRequired. An expression to append to the tail of the array

Example

The following example creates a new array initialized with two elements: '1' and '2'.

We then append a third element, '3', to the end of the array using the array.add function.

Alchemy
$arr = array.new(1, 2);
PRINT $arr; /* [1,2] */
array.add($arr, 3);
PRINT $arr; /* [1,2,3] */

See Also

  • array.last - get the last element of an array

  • array.new - create a new array

  • array.pop - remove and return the element at the head of the array

  • array.set_at - modify the data at a specified index of an array

  • array.get_at - retrieve the data at a specified index of an array

  • length - get the number of elements in an array