An array object is a collection of objects that can be of different types. Each member object of an array has a "subscript" that represents its position in the array, which is zero-based
Method of array Definition:
1. Defines an empty array:
var array name = new Array ();
2. Define an array of n empty elements when specified:
var array name =new array (n);
3. When defining an array, initialize the data directly:
var array name = [< element 1>, < element 2>, < element 3>...];
We define the MyArray array and assign the values to the code as follows:
Description: defines an array myArray, inside the element is: myarray[0] = 2; MYARRAY[1] = 8; MYARRAY[2] = 6.
Array elements are used:
Array name [subscript] = value;
Note : The subscript of the array is enclosed in square brackets, starting with 0.
Array properties:
Length usage:< Array Object >.length; return: The length of the array, which is the number of elements in the array. It equals the subscript of the last element in the array plus one.
Array method:
The above methods do not explain all, only part of the method. This section has no tasks, quickly go to the next section to learn.
7.Array Array Object