I've just noticed that I can do the following in JavaScript:
var z = -0;
console.log(z); // prints -0
Why does the unary negation works on zero?
Is this one of the many JavaScript quirks or it does (somehow) have a purpose?
P.S.:
It seems to be happening on Firefox 38.0a2 and Chrome 41.0.2272. On Node.js v0.10.36 doesn't happen. Dunno about IE.