@List (JavaScript)

Creates a list.

Defined in

@Functions (JavaScript)

Syntax

@List(values:...) : any
Parameter Description
values One or more parameters of any type. Each parameter becomes an element in the list.
Return value Description
any The list.

Usage

A list is an array.

Examples

This example creates a list with 4 elements.
function p(stuff) {
	print("<<<" + stuff + ">>>"); 
 }

var cities = @List("Paris", "Berlin", "London", "Moscow");
for(var i = 1; i <= @Count(cities); i++) {
	p(i + " " + @Element(cities, i));
}
/*
<<<1 Paris>>>
<<<2 Berlin>>>
<<<3 London>>>
<<<4 Moscow>>>
*/