Click or drag to resize

Array

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

An array is a sequence of elements. Alchemy arrays are indexed from zero and dynamically expand.

An array is denoted by the "[" and "]" symbols, with elements separated by commas (',').

Examples

The following are examples of valid arrays:

Alchemy
[]
[1, 2, 3, 4]
["Alpaca", "Buffalo", "Cheetah"]
[1, [1,1], [1,2,1], [1,3,3,1]]
See Also

Alchemy includes a number of built-in functions that may be used to manipulate arrays. These functions include:

  • array.add - add an element to an array

  • array.contains - tests whether a value is contained in an array.

  • array.first - access the first element in an array

  • array.flatten - expands single array elements (of type array)into multiple elements.

  • array.get_at - access an element in an array by index

  • array.join - converts an array to a string, inserting a specified delimiter between elements.

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

  • array.new - return a new 1-dimensional array initialized by the supplied values.

  • array.pop - pop an element from the head of an array

  • array.range - retrieve an range of consecutive elements from an array

  • array.set_at - set the data stored in an element by index