Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.This function is valid in v2.0.0 to v2.20.0. This function has been downloaded 32 times.
slice(array,-2)extracts the last two elements in the sequence. If
undefined, slice begins from index
end. For example,
slice(array,1,4)extracts the second element through the fourth element (elements indexed 1, 2, and 3). A negative index can be used, indicating an offset from the end of the sequence.
slice(array,2,-1)extracts the third element through the second-to-last element in the sequence. If
sliceextracts through the end of the sequence (
endis greater than the length of the sequence, slice extracts through the end of the sequence (
This function requires the following function which is included automatically: