What the best way to remove duplicates from an array of objects?
var array = [
{a: 0, b: 0, c: 0},
{a: 0, b: 0, c: 0},
{a: 1, b: 1, c: 1},
{a: 1, b: 1, c: 1},
//..... etc
];
And, i want to get like:
[
{a: 0, b: 0, c: 0},
{a: 1, b: 1, c: 1}
];
PS: the keys (a, b, c) have only primitive data type (String, Number)
Please, without underscore.js and other libs.
I’m sure there is better ways to do this, but you can use this prototype function.
How to use it
Note:
You should avoid this for big arrays, out there are better solutions