0
Why both {}=={} and {}==={} are false?
2 Antworten
+ 8
Objects are compared not by their contents but by their references in memory. And since every single created object in memory has a unique reference, comparing them will always yield false.
+ 4
Because == and === works just for primitive types.
Also, whenever you create an object it's associated with a __proto__ object which is unique for every object.