Javascript oddness with array of objects and indexOf

Array.indexOf() will only work on objects if the supplied object is exactly the same object you put in.

An exact copy is insufficient, it has to be the exact same object, i.e. there must be some object in the array such that:

arr[i] === obj

You need to show how you retrieved the object.

Leave a Comment