I came across a statement "If -0 is subtracted from +0, the result is -0" in a JavaScript book published in year 2012.
However, when I compute +0 - (-0)
in browser, it returns 0
instead of -0
. I would like to know whether there is a change in ECMAScript since then or is it just simply an error/typo in the book.
If what the book mentioned is true, I would like to hear explanation and elaboration on this part.
Book: Professional JavaScript for Web Developers, 3rd Ed. by Nicholas C. Zakas (Chapter 3 - pg 63)