Answers for "I have an object that I want to map through but want to omit repeating certain stuff from it. How do I do that?"

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

Code answers related to "I have an object that I want to map through but want to omit repeating certain stuff from it. How do I do that?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language