3 ms·
'==' or '===' is not an equality operator when used on objects (including arrays) in Javascript. It's a reference equality operator: are the two variables refer
by ballenf 10y ago
'==' or '===' is not an equality operator when used on objects (including arrays) in Javascript. It's a reference equality operator: are the two variables referencing the same object?
There is no builtin object content equality binary operator in Javascript, at least as of ES5.
- catnaroek 10y agoEquality for objects means reference equality. That's precisely the problem with object-oriented languages: you can't manipulate the values that you really want, you have to manipulate objects whose state is hopefully the value you want.