Syntax | |
| |
The slice() method returns a new array that contains the elements of the original array starting at position start and ending at the element position before stop. | |
If no stop position is specified, the new array will contain the elements of the original array, starting at the position stated in start through the end of the array. | |
Negative numbers start to count from the last element to the first. | |
For example, -1 is the last element in the array, and -2 is the second to the last element in the array. | |
The stop parameter can be negative. | |
|