drop
Modified on Fri, 18 Aug 2023
Description
Create a slice of array with 'n' elements dropped from the beginning.
Syntax
drop(array, n)
Parameters
Input Parameter | Type | Description |
---|---|---|
array | Array | The array to query |
n | number | The number of elements to drop |
Return value
Type |
---|
Array<any> |
Sample
Example | Result | Description |
---|---|---|
drop([1, 2, 3], 1) | [2, 3] | Drop the first element |
drop([1, 2, 3], 2) | [3] | Drop first two elements |
To view all the List functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article