I am trying to remove duplicate objects from an Array. For example, the object 'bison' appears twice.
var beasts = [ {'ant':false}, {'bison':true}, {'camel':true}, {'duck':false}, {'bison':false} ];
This is my attempted solution:
let a = beasts.indexOf(bison);
console.log(a);
However, I keep getting -1 as the result, indicating that the object cannot be found in the array.
Please note that the values of the objects are not relevant for this question.