Answers for "remove duplicate from array of object"

7

remove duplicate objects from array javascript

const addresses = [...]; // Some array I got from async call

const uniqueAddresses = Array.from(new Set(addresses.map(a => a.id)))
 .map(id => {
   return addresses.find(a => a.id === id)
 })
Posted by: Guest on January-02-2020
0

how to remove duplicate object in array javascript

arr.filter((v,i,a)=>a.findIndex(t=>(t.place === v.place && t.name===v.name))===i)
Posted by: Guest on August-18-2021

Code answers related to "remove duplicate from array of object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language