I was reading a book called Speaking JavaScript by Axel Rauschmayer. Here, I came to know that -0 value exists in JavaScript.
So, below is a valid expression:
var num = -0;
After exploring further, I came to know that it's value is similar to 0.
var num1 = -0;
var num2 = 0;
num1===num2//true;
As per Mathematics, 0 is a non-negative number. So, basically JavaScript is violating mathematics principle.
I am curious to know the reason behind doing so. Does it has any crucial significance? Note: all the above observation were made on Google Chrome. Thanks.