Removing duplicate objects (based on multiple keys) from array

Late one, but I don’t know why nobody suggests something much simpler:

listOfTags.filter((tag, index, array) => array.findIndex(t => t.color == tag.color && t.label == tag.label) == index);

Leave a Comment