This article describes the detailed explanation of the JavaScript advanced Array (10). For more information, see
JS array details
Array declaration methodArrayObj = new Array ();
// Create an array.
Var arr1 = new Array ();
ArrayObj = new Array ([size])
// Create an array and specify the length. Note that the length is not the upper limit.
Var a = new Array (5 );
ArrayObj = new Array ([element0], [element1],..., [elementN])
// Create an array and assign values.
Var a = new Array (["B", 2, "a", 4,]);
ArrayObj = [element0, element1,..., elementN]
// Create an array and assign values in short. Note that brackets do not indicate that they can be omitted.
Var a = ["B", 2, "a", 4,];
Note: note the difference between "[]" and "[]".
Var a = new Array (5); // creates an Array of 5 characters.
Var a = new Array ([5]); // creates an Array with a length of 1 and a first value of 5.
Array Operation (Transfer address)
Var t2 = new Array (); t2 [0] = 1; t2 [1] = 2; test2 (t2); // transfer address (Array) function test2 (var2) {for (var I = 0; I
The above is a detailed explanation of the JavaScript advanced Array (10). For more information, see PHP Chinese Network (www.php1.cn )!