@justinc/extract-duplicates

1.0.0 • Public • Published

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 }

Package Sidebar

Install

npm i @justinc/extract-duplicates

Weekly Downloads

5

Version

1.0.0

License

ISC

Last publish

Collaborators

  • justinc