I have the following code:
var person = { name: "Nicholas" };
var people = [{ name: "Nicholas" }];
var morePeople = [person];
alert(people.indexOf(person)); //-1
alert(morePeople.indexOf(person)); //0
I can't figure out why first alert gives -1 (not found) when people is an array and contains { name: "Nicholas" }