Created
April 29, 2016 20:30
-
-
Save easierbycode/0e61ccc06ae536086531b1aec7514d0a to your computer and use it in GitHub Desktop.
can be used to replace '==='. fixes some ES5 issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let notNum = NaN; | |
| console.log( notNum === notNum ); | |
| // false | |
| console.log( Object.is(notNum, notNum) ) | |
| // true | |
| let amt = 0, total = -0; | |
| console.log( amt === total ) | |
| // true | |
| console.log( Object.is(amt, total) ); | |
| // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment