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

353 B

duplicates()

The duplicates method retrieves and returns duplicate values from the collection:

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

const duplicates = collection.duplicates();

duplicates.all();

// { 2: 'a', 4: 'b' }

View source on GitHub