drop es-toolkit
Returns a new array with the specified number of elements removed from the beginning.
Usage
drop(arr, itemsCount)
Use drop when you want to remove some elements from the beginning of an array. It removes the specified number of elements from the start and returns a new array with the remaining elements.
If you pass a negative number or 0, it returns a new array with the same elements as the original.
Parameters
The array to remove elements from.
The number of elements to remove from the beginning of the array.
Returns
A new array with the specified number of elements removed from the beginning.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.