You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
308 B

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