The variable items in an arrays are called element of array, element are indicated by an index,
The length of an arrays in the number of element that are contained in an array. Array element index starts with Zero (0).
Syntax for creating an arrays is:
var arrayname = new array ()
var arrayname = new array (array length)
Here first example create an array of size zero and second specified the size of array.
Example of array declaraction are:
var day = new array (31);
var month = new array (12);
var n = new array (10, 20, 30, 40);
Creating array by simply assigning value
The individual element of an array accessing by using the name of an array by the index value of the array element enclosed in square brackets .
var i = ["apple","orange","mango"];
Here i has three element.
i  is the first element.
i  is the second element.
i  is the third element.
i = new array ("ab",2,true,new array(1,3));
Here i has four element.
i = "ab"
i = 2
i = true
i = 1,3.
Here last element i of array i is a dense array with two values 1 and 2. These two element can be accessed using a second set of subscripts as:
n1 = i;
n2 = i;