Object.is and signed zero comparison
alisey opened this issue · comments
Alexey Lebedev 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
Nicolás Bevacqua commented
Care to PR?
Nicolás Bevacqua commented
Fixed by #5