@justinc/extract-duplicates
v1.0.0
Published
Extract duplicate elements from an Iterable
Downloads
12
Maintainers
Readme
Install
npm i @justinc/extract-duplicates
extractDuplicates(iterable) ⇒ Set.<*>
Extracts duplicates from given iterable. Returns a Set of the found duplicates. When deciding whether an element is a duplicate, the native Set's equality is used (for performance reasons). This is value equality.
Kind: global function
| Param | Type | | --- | --- | | iterable | Iterable.<*> |
Example
const extractDuplicates = require('@justinc/extract-duplicates')
extractDuplicates([1,2,1,1,2,3])
// Set { 1, 2 }