Mega Code Archive

 
Categories / JavaScript Tutorial / Array
 

Arrays Constructor

Constructors: var variable = new Array() var variable = new Array(int) var variable = new Array(arg1, ..., argN) These constructors create a new array and initialize the Array object based on the arguments passed in the parameter list. The constructor that has no arguments sets the length property to 0. int-- An array is created and its length property is set to the value int. arg1,...argN--An array is created and the array is populated with the arguments. The array length property is set to the number of arguments in the parameter list. The newly created array is returned from the constructor.