Object.is and signed zero comparison
alisey opened this issue · 2 comments
alisey commented
Object.is -- like using the === operator programmatically, but also true for NaN vs NaN and +0 vs -0
It's false for +0 vs. -0:
Object.is(+0, -0); // => false
Object.is(-0, -0); // => true
From MDN:
Two values are the same if one of the following holds:
[...]
both numbers and
- both +0
- both -0
- both NaN
bevacqua commented
Care to PR?