The var list = new Array () is the code that we often write in JS, which summarizes what methods the objects of the AHA Array have today.
List[0] = 0;
LIST[1] = 1;
LIST[2] = 2;
Or declare this: var list = [0,1,2]
1 shift ()T: Deletes the first element of the array, returning the deleted value. This is 0.
2 unshift (3,4): Returns the length of the array by loading the arguments in front of the array. Now list: Medium is 3,4,0,1,2
3pop (): Deletes the last element of the array, returning the deleted value. This is 2.
4push (3): Loads the parameter to the end of the array, returns the length of the array, and now in list: 0,1,2,3
5concat (3,4): The two arrays are stitched together.
6splice (start,deletecount,val1,val2,...): Deletes the DeleteCount entry starting from the start position and inserts the Val1,val2 from that position,...
Reverse: Reverse the array
var a = [1,2,3,4,5];
var B = A.reverse (); a:[5,4,3,2,1] b:[5,4,3,2,1]
sort (orderfunction): Sorts the array by the specified parameters
var a = [1,2,3,4,5];
var B = A.sort (); a:[1,2,3,4,5] b:[1,2,3,4,5]
Slice (start,end): Returns a new array that consists of the entries from the original array that specify the starting subscript to the end subscript
var a = [1,2,3,4,5];
var B = a.slice (2,5); a:[1,2,3,4,5] b:[3,4,5]
Join (separator): Sets the element group of the array as a string, separator as a delimiter, and the default comma delimiter if omitted.
var a = [1,2,3,4,5];
var B = A.join ("|"); a:[1,2,3,4,5] B: "1|2|3|4|5"
A summary of some common methods of array arrays in JS