In JavaScript We all know that {} !== {}
– they are different objects allocated on heap. But I was trying to find the reason at the language specification level.
at https://tc39.es/ecma262/#sec-samevaluenonnumeric it says
- If x and y are the same Object value, return true. Otherwise, return false.
But it is unclear to me how the spec defines exactly when two objects are considered to have the same Object value. Like {}
and {}
clearly do not have the same value but how exactly is it defined in the spec?