array-unique
array-unique copied to clipboard
Create for.js
Same as https://github.com/jonschlinkert/array-unique/blob/master/benchmark/code/while.js, but preserves the order of elements in result array, which is nice to have.
Performance is almost as good as while.js
BTW, is there any reason the implementation in https://github.com/jonschlinkert/array-unique/blob/master/index.js is not from https://github.com/jonschlinkert/array-unique/blob/master/benchmark/code/while.js ?
For me on node 0.12.0 array-uniq with Set is the fastest on arrays bigger than 1000 elements. In all other cases https://github.com/jonschlinkert/array-unique/blob/master/benchmark/code/while.js is the fastest.
Ah, and the description for https://www.npmjs.com/package/array-unique currently says
Return an array free of duplicate values.
which is confusing, as current implementation from https://github.com/jonschlinkert/array-unique/blob/master/index.js removes elements from the original array.
this is great! thanks for all the hard work and making this lib better! I have some father's day stuff going on today, but I'll review and merge in your pr as soon as I have a chance
Sure, important stuff first. Thanks for super quick reply, really appreciate.