dedupe

remove duplicates from your array

npm install dedupe
1 downloads in the last day
17 downloads in the last week
57 downloads in the last month

dedupe

Build Status

NPM

NPM

removes duplicates from your array.

primitive types

var a = [1,2,2,3];
var b = dedupe(a);
console.log(b);

//result: [1,2,3];

complex types

var aa = [{a:2},{a:1},{a:1},{a:1}];
var bb = dedupe(aa);
console.log(bb);

//result: [{a:2},{a:1}]

complex types types with custom hasher

var aaa = [{a:2, b:1},{a:1, b:2},{a:1, b:3},{a:1, b:4}];
var bbb = dedupe(aaa, function(value) { return value.a; });
console.log(bbb);

//result: [{a:2,b:1},{a:1,b:2}]
npm loves you