Get a unique list of objects in an array of objects in JavaScript