Consider the following
var l = console.log.bind(console); l(-0); // 0 l(0); // 0 l(0 === -0); // true l(0 == -0); // true l(1 / 0); // Infinity l(1 / -0); // -Infinity
- Why is negative zero equal to zero?
- Given this, why does he behave differently?
Bonus question:
- Is the
0 / -0 combination the only one in which identical objects behave differently?
I know that NaN / NaN is a combination in which unequal objects behave the same.
source share