In JavaScript, in what situation(s) is a === b, but using a or b can give different results?

javascript

Solution

No. According to the Strict Equality Comparison Algorithm (EcmaScript §11.9.6) this is the only exception where two different values produce `true`.

However, a similar pitfall exists for the reverse situation: `NaN` is an exception where calling the algorithm with the exact same value yields `false`.

Problem

It may look like if `a === b` is `true`, then any operation using either `a` or `b` should give the exact same result. But I do see an exception: `0 === -0` but `1/0` gives `Infinity` and `1/-0` gives `-Infinity`. Are there any other case(s) in JavaScript this can happen?

Original source