0
Function
Why output false if consistence both object the same? https://code.sololearn.com/W4sbt54Q71vO/?ref=app
2 odpowiedzi
+ 5
It's because it checks what they are referencing to. If you have the object {x: 1}, and {x: 1}, they will be different objects, with the same values. To make them true, you have to make their reference the same:
a = {x: 1};
b = a;
console.log(a == b); // True
0
Wow! You awesome