I have created the following code http://jsfiddle.net/EbCUx/
var arr = [{a:1,b:2,c:3},{a:3,b:5,c:6}];
var a = arr[0];
alert(arr.indexOf(a));
var b = {a:1,b:2,c:3};
alert(arr.indexOf(b));
Why indexOf() returns -1 eventhough contents of a and b are same.. I know that a is a reference value ..Is that the cause...And can anybody explain me the exact reason?