0

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
User123
  • 453
  • 2
  • 6
  • 17

1 Answers1

0

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

intekhab
  • 1,566
  • 1
  • 13
  • 19