Array.slice

Array slice ()

Description

Creates a new array, which contains a subset of the original array’s elements.

The slice begins with the index start, and continues up to, but not including the index, end. If start or end is a negative number, the indexed is resolved counting backwards from the end of the array resulting in the element array[array. length + negativeIndex]. Returns a new array containing elements array[start] through array[end-1].