my-idlers/node_modules/collect.js/docs/api/nth.md
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

308 B

nth()

The nth method creates a new collection consisting of every n-th element:

const collection = collect(['a', 'b', 'c', 'd', 'e', 'f']);

const nth = collection.nth(4);

nth.all();

// ['a', 'e']

View source on GitHub