Array() (Function)

An Array object constructor.


ECMAScript edition - 2
JavaScript - 1.1
JScript - 3.0
Internet Explorer - 4.0
Netscape - 3.0
Property/method value type:Array object
JavaScript syntax:-Array()
-Array(anItem1, anItem2, anItem3, ...)
Argument list:aLengthAn optional initial length for the array
anItemNA variable number of initial elements to insert into the array.

Calling the Array() constructor as a function behaves exactly the same as if it had been called with the new operator.

The function call Array() is equivalent to the object creation expression new Array() with the same arguments. With other primitive objects, calling the constructor as a function carries out a type conversion instead of an object instantiation.

The arguments passed to the constructor affect the way that the array is initialized in the same was as they do with a new Array() expression..

See also:Array object, Array(), Array.prototype, Cast operator, Constructor function, constructor property, Implicit conversion


ECMA 262 edition 2 - section -

ECMA 262 edition 2 - section - 15.4.1

ECMA 262 edition 2 - section - 15.4.2

ECMA 262 edition 3 - section - 15.4.1