javascript filter duplicates from array of objects