Link Search Menu Expand Document


Returns the element at a location <value> index from the given array. Indexes in an array begin at position 1.


ELEMENT_AT(<array>, <value>)


Parameter Description Supported input types
<array> The array that the function is applied to. ARRAY of any type
<value> The index that is matched by the function.
Negative indexes are supported. If used, the function selects the corresponding element numbered from the end. For example, array[-1] is the last item in the array.

Return Types

Same as the element data type of the input array


The following example displays the player’s current level by returning the element at the index of 2:

	ELEMENT_AT([ 1, 2, 3, 4 ], 2) AS current_level;

Returns: 2