Created
August 30, 2017 08:41
-
-
Save 92hackers/ae8e3dd89778d8375715b97a0e1d0da2 to your computer and use it in GitHub Desktop.
Three kinds of comparisons in Javascript
This file contains 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
// 1, Object.is | |
Object.is('hello', 'hello') | |
// => true | |
Object.is(+0, -0) | |
// => false | |
Object.is(NaN, NaN) | |
// => true | |
// 2, === | |
NaN === NaN | |
// => false | |
+0 === -0 | |
+0 === 0 | |
// => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment