Files
rspade_system/node_modules/collect.js/docs/api/nth.md
2025-12-03 21:28:08 +00:00

15 lines
308 B
Markdown
Executable File

# `nth()`
The nth method creates a new collection consisting of every n-th element:
```js
const collection = collect(['a', 'b', 'c', 'd', 'e', 'f']);
const nth = collection.nth(4);
nth.all();
// ['a', 'e']
```
[View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/nth.js)