I am having an array of objects in which i would like to find the index of the selected object when i used the indexOf i am getting the value as -1 can anyone tell me how to find the indexOf of an object in javascript
var a = [{id:2322,location:"Erode",mobile_no:"123456789",name:"andhr",type:"Farmer"}, {id:2323,location:"Coimbatore",mobile_no:"123456789",name:"andhraK",type:"Farmer"}, {id:2324,location:"Erode",mobile_no:"123456789",name:"andhra",type:"Farmer"}];
a.indexOf({id:2322,location:"Erode",mobile_no:"123456789",name:"andhra",type:"Farmer"});