ArrayNew

create a new array. shorthand syntax is [].

ArrayNew( [ dimension [, type [, synchronized ] ] ] )

Returns: Array

Argument Description Default
dimension
number, optional

Number of dimensions in new array: 1, 2, or 3

1

type
string, optional

type of the array created, if set the array does not have any specific type.

synchronized
boolean, optional

is the array synchronized or not (aka thread safe)

false

Examples

### create a new array, set the dimension
  a = arrayNew(1);
    // Implicit array notation
    a.append([]);
    // with values
    a.append( [
        'a','b', 
        3, 4,
        [], 
        {complex: true},
        queryNew("id,date")
    ] );
    dump(a);

See also