re: Removing duplicates in an Array of Objects in JS with Sets VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I have also this solution O.o const dupAddress = [ { id: 1, name: 'Istanbul' }, { id: 2, name: 'Koca...
 

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

 

Okay, I tried it didn't work actually I was wonder why that didn't work. Thanks.

code of conduct - report abuse