DEV Community

Discussion on: 3 ways to remove duplicates in an Array in Javascript

Collapse
 
phibya profile image
Phi Byă

For big array of objects, use reduce and Map:

[{a: 1, b: 2}, {a: 2, b: 3}, {a: 1, b: 2}].reduce((p, c) => p.set(c.a, c), new Map()).values()