I have an array of objects that I would like to trim down based on a specific key:value pair. I want to create an array that includes only one object per this s
key:value
Simple solution although not the most performant:
var unique = []; duplicates.forEach(function(d) { var found = false; unique.forEach(function(u) { if(u.key == d.key) { found = true; } }); if(!found) { unique.push(d); } });