Change the original array

1, length: if you directly modify arr. Length, length is greater than the original length, then the empty part will become empty, length is less than the original length, then the back part will be deleted.

Push () :arr.push(‘1′,’2’), add elements to the end of the array, can add more than one element, return the modified array length; Let length = [1,2,3]. Push (4,5)//5.

3. Unshit (): Inserts an element to the beginning of an array. You can add more than one element and return the length of the array after modification.

Shift (): Deletes the first element of the array and returns the deleted element.

Pop (): removes the last element of the array and returns the deleted element.

8, splice(): can delete or modify, add the specified element in the array. Splice (index,length,… New item), the first parameter index represents the starting position, the second parameter length represents the number of deletions, and the third and subsequent parameters represent the passing of new elements

These elements are automatically inserted before the index, returning the array of deleted elements.

9. Reverse (): Used to reverse an array and return the array that has been reversed.

Sort (a,b)=>{return a-b}); sort(a,b)=>{return a-b});

CopyWithin (target,index=0,end=this.length); Copy all the way to end-1, and then replace it all at the beginning of target’s subscript. Back after modification

The original array of.

Fill (val,start,end), fill(val,start,end), fill(val,start,end), fill(val,start,end), fill(val,start,end), fill(val,start,end)

All the way to the end.

Do not change the original array

ForEach ((v,index,arr)=>{}):arr. ForEach (v,index,arr)=>{}):arr. ForEach (v,index,arr)=>{}):arr.

Concatenate (): concatenate two or more arrays,arr. Concat (arr2,arr3), and return the new concatenated array.

Join (): join(‘,’)\join(‘-‘) returns the new string as the result.

16, toString(): same as join() does not add a concatenation, is used to join elements as a string return.

Arr. Every ((value)=>{return value > 0}) returns true if it is true and false if it is not.

Arr.some ((value)=>{return value > 0}) returns true, or false.

19, map(): used to call the callback function for each element of the array to do the corresponding processing, map((item,k.arr)=>{}), will return the new array after processing.

Find ((item,index,arr)=>{}) returns the first element that matches the condition.

21, findIndex (); FindIndex ((item,index,arr)=>{}) returns the index of the first element that meets the condition.