Click or drag to resize

array.new Function

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

The array.new function returns a new 1-dimensional array, initialized with a given variable list.

Alchemy arrays use zero-based indexing.

Syntax

Alchemy
array.new(list);

Nomenclature

list A mandatory list of variables used to initialize the array.

Example

The following example creates a new array, initialized with three elements.

Alchemy
$arr = array.new(1, null, "element!");
PRINT $arr; /* [1,(null),element!] */

See Also

  • array.add - add an element to the tail of an array

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

  • array.flatten - expand elements of an array that are, themselves, arrays

  • array.join - convert an array to a string by joining all the elements

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

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

  • array.range - return a sub-array from a specified 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