1, Slice ()
Method: Arrayobject.slice (Start,end)
Return value: Returns a new array containing elements from start to end (excluding the element) in the Arrayobject.
2, Splice ()
Method:Array. Splice (index,howmany,item1,.....,ItemX)
index: Where to add/remove elements from
howmany: How many elements should be removed. Must be a number, but it can be "0". If this parameter is not specified, all elements from index start to the end of the original array are deleted.
Item: Optional. The new element to add to the array.
The return value: the Splice () method modifies the array directly, and if the element is removed from the Arrayobject, it is returned as a set of elements containing the deleted element.
3, concat ()
Method: Arrayobject.concat (Arrayx,arrayx,......, Arrayx)
Return value: The method does not alter an existing array, but simply returns a copy of the concatenated array.
4.
filter()
方法:arr.filter(callback[, thisArg])
callback
: A function used to test each element of an array. Called Using parameters (element, index, array). Returns true to preserve the element (passed test), false is not preserved.
thisArg
: Optional. callback
the value to use when executing this
.
The return value, a new array that contains the test pass element. filter
does not change the original array.
JS Basics-Common Array manipulation methods