=== does not always mean a point for the same object. It works with objects, but by type of value, it compares the value. From here how it works:
var x = 0; var y = 0; var isTrue = (x === y); document.write(isTrue);
JavaScript uses the IEEE floating point standard, where 0 and -0 are two different numbers, however the ECMAScript standard states that the parser should interpret 0 and -0 as the same:
ยง5.2 (p. 12)
Mathematical operations such as addition, subtraction, negation, multiplication, division, and mathematical functions defined later in this section should always be understood as calculating exact mathematical results from mathematical real numbers that do not include infinity and do not include negative zero, which differs from positive zero . Algorithms in this standard that model floating point arithmetic include explicit steps, where necessary, for handling infinities with both zero sign and rounding. If a mathematical operation or function is applied to a floating-point number, it should be understood as applying to the exact mathematical value represented by this floating-point number; such a floating point number must be finite, and if it is +0 or -0, then the corresponding mathematical value will be just 0 .
Cole johnson
source share