![]() |
VOOZH | about |
The splice() method is used to remove and returns a slice of items starting at the specified index
Syntax:
collect(array).splice()
Parameters: The collect() method takes one argument that is converted into the collection and then splice() method is applied on it.
Return Value: This method returns a slice of items starting at the specified index.
Below example illustrate the splice() method in collect.js:
Example 1:
Output:
[6, 5, 11, 3] [8, 4, 7]
Example 2:
Output:
[5, 11, 3] [8, 4, 7, 6]