drop
Summary
Returns a new list without the first n
elements of the original list.
Tip
This function is curried.
Description
Drops the first n
items from xs
and returns the rest in a new list of the same type.
When n
is 0 or negative drop
does nothing.
When n
is larger than the number of items drop
returns an empty list of the same type.
Examples
Works with arrays and objects
1 2 3 4 5 6 7 |
|
Parameters
Name | Type | Description |
---|---|---|
n | number |
Number of items to drop. |
xs | Array or Object |
List to drop from. |
Return
Array
or Object