Js array of method - whether to change the original array

Does not change the original array are:
concat () --- connect two or more arrays, and returns the result.

Whether each element of every () --- detection array elements are eligible.

some () Are there elements that meet the specified conditions --- detection array element.

filter () --- detection array element, and returns an array of all elements eligible.

indexOf () --- search for elements in the array and returns its location.

the Join () --- all the elements of the array into a string.

toString () --- the array to a string, and returns the result.
lastIndexOf () --- return position a specified string value of the last occurrence of a specified position in a string from the forward search.

Map () --- through each array element designated processing function, and returns an array processed.

Slice () --- array select part, and returns a new array.

valueOf () --- array object to the original value.

-----------Dividing line-------------------

Will change the original array are:
POP () --- delete the last element of the array and returns the removed element.

Push () --- add one or more elements to the end of the array, and returns the new length.

shift () --- Removes and returns the first element of the array.

the unshift () --- add one or more elements to the beginning of the array, and returns the new length.

Reverse () --- reverse the order of elements in the array.

sort () --- sort of elements of the array.

splice () --- insertion, deletion or substitution of elements of the array.

 

Reprinted: https://www.cnblogs.com/chengfeng6/p/10383871.html

Guess you like

Origin www.cnblogs.com/xjy20170907/p/11115898.html