Javascript array of objects - filter by uniqueness of specific key, and keep only certain keys
'm sure this question has been asked in some form here before, but I am having trouble finding the right solution. I have an array of objects like this: [ {id:"124", name:"Matt", lname:"Will", age:"14"}, {id:"124", name:"Matt", lname:"Will", age:"17"}, {id:"124", name:"Matt", lname:"Will", age:"21"}, {id:"128", name:"Colson", lname:"Baker", age:"18"}, {id:"132", name:"Mike", lname:"Baker", age:"21"} ]; and I would like to shorten this array so that it only includes objects with unique id keys, as well as only the keys id, name, lname. The output I'm going for then is: [ {id:"124", name:"Matt", lname:"Will"}, {id:"128", name:"Colson", lname:"Baker"}, {id:"132", name:"Mike", lname:"Baker"} ]; What I've done so far - I can use the following code snippet to create an array of unique IDs, but that isn't getting me to where I need to go: let uniqueIDs = [... new Set(mydata.map(val => val.id))]; Any help is appreciated!!