I have also this solution O.o
const dupAddress = [
let addresses = [...new Set([...dupAddress.map(address => dupAddress[address.id])])]
But this only works with address.id, so this doesn't work with address.name
Really, why this doesn't work like that?
let addresses = [...new Set([...dupAddress.map(address => dupAddress[address.name])])]
Well, you're passing [address.id] as an index to the dupAddress array, that's just not going to work because the id !== index. Try changing it to address.id or address.name without accessing the array
id !== index
Okay, I tried it didn't work actually I was wonder why that didn't work. Thanks.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.