Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wasn't aware of that. I thought ES2015 added Object.is() for this purpose: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


The main difference between === and Object.is() is that === treats +0 and -0 as equivalent, despite the fact that some math operations treat them differently. I think they added Object.is() because it was awkwardly difficult to make code tell the difference between +0 and -0.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: