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
353 B

4 years ago
  1. # `duplicates()`
  2. The duplicates method retrieves and returns duplicate values from the collection:
  3. ```js
  4. const collection = collect(['a', 'b', 'a', 'c', 'b']);
  5. const duplicates = collection.duplicates();
  6. duplicates.all();
  7. // { 2: 'a', 4: 'b' }
  8. ```
  9. [View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/duplicates.js)