DEV Community

Discussion on: Removing duplicates in an Array of Objects in JS with Sets

Collapse
 
drozerah profile image
Drozerah • Edited

Hi ! One other one line path to Rome, from France :


arr = arr.filter((power, toThe, yellowVests) => yellowVests.map(updateDemocracy => updateDemocracy['id']).indexOf(power['id']) === toThe)

console.log(arr)

Enter fullscreen mode Exit fullscreen mode


`

Collapse
 
marinamosti profile image
Marina Mosti

Merci! :)

Collapse
 
arthurcat profile image
ArthurCat

More JS but too slow.