array-uniq
Create an array without duplicates
It's already pretty fast, but will be much faster when Set becomes available in V8 (especially with large arrays).
Install
$ npm install --save array-uniq
Usage
var arrayUniq = ; ;//=> [1, 2, 3] ;//=> ['foo', 'bar'] var Collection = ;var collectionUniq = Collection;var col = instanceof Collection//=> false instanceof Collection//=> true
This is only necessary when no Set
implementation exists, because when using Set
, array-uniq
delegates to the array's filter
method.
License
MIT © Sindre Sorhus