I am checking obeject comparison, below two instance gives 'false' and anyone can explain why?
var a = {x:7, y:9};
var b = {x:7, y:9};
console.log(a==b); //false
console.log(a===b); //false
I am checking obeject comparison, below two instance gives 'false' and anyone can explain why?
var a = {x:7, y:9};
var b = {x:7, y:9};
console.log(a==b); //false
console.log(a===b); //false
a
is not a primitive value. a
is just refers to an object and b
refers to another object. Both are holding reference of different object
.
Both can not be same