Files
ihrm/node_modules/collect.js/docs/api/nth.md
Nikhil Ravi Cybrosys e1794e7422 [UPDT]translations in the views (#4)
[UPDT]Translations in the views
[FIX]major bug fixes
2023-05-18 15:05:28 +05:30

15 lines
322 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)