数组indexOf方法

var the_arr = [
                {"id":1,"name":"Tom"},
                {"id":2,"name":"Cathy"},
                {"id":3,"name":"Jack"}];

var the_obj  = the_arr[1]; 
var the_obj_ = {"id":1,"name":"Tom"};



console.log(the_arr.indexOf(the_obj));   //return  1
console.log(the_arr.indexOf(the_obj_));  //return -1
原文地址:https://www.cnblogs.com/oy-lee/p/8509148.html