@Element (JavaScript)
Returns an element of a list.
Defined in
@Functions (JavaScript)Syntax
@Element(list:any, position:int)
: any
Parameter | Description |
---|---|
list |
The list to be checked. |
position |
The position of the element starting at 1. |
Return value | Description |
---|---|
any |
The element of the list at the given position. |
Usage
A list is an array.The numbering of elements starts at 1 for @functions not 0.
Examples
This example iterates through a list.function p(stuff) {
print("<<<" + stuff + ">>>");
}
var citiesArray = new Array("Paris", "Berlin", "London", "Moscow");
for(var i = 1; i <= @Elements(citiesArray); i++) {
p(@Element(citiesArray, i));
}