Definition of the array: ①var arr=new Array (xx,xx,xx); ②var Arr=[yy,yy,,yy];
View of the array: arr[x];
Modification of the array: arr[x]=xx;
Traversal of the array: ①for loop ② (for...in loop) for (Var i in arr) {Arr[i]};
The length of the array: arr.length; (the total number of elements in the array)
Array method: Arr.pop () Delete the last element
Arr.push () Adds an element at the end of the array
Arr.shift () Delete the first element
Arr.unshift () Adds an element to the front of the array
!!! All of the above methods change the original array
Arr.join ('-') joins an array with '-' to make it a string
Arr3=arr1.concat (ARR2) joins array 3 as array
Arr.slice (A, B) will array arr, intercept from A to B (does not contain B.) does not change the original array
Arr.splice (A, b) ditto, but change the original array
Arr.sort (); the sort of an array is sorted by the first value of the number, not by the size of the numeric value!
2018-06-17 Array