Is there a way to remove dupilicates making sure that the nth index is always left. So if I have
[{name: "john", age:20},{name:"john", age:30}]
I would need the result to always be
[{name:"john",age:30}]
currently, I'm using this method of removing dups
PICKER.saveSelection = PICKER.saveSelection.filter((select, index, self) => {
return self.map(function(mapItem){ return mapItem["category"]; }).indexOf(select["category"]) === index;});