Last active
July 13, 2021 09:45
-
-
Save Kotrotsos/d821491d446c691a4061cfb06368f3ad to your computer and use it in GitHub Desktop.
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
isNaN(NaN) // true | |
isNaN(undefined) // true | |
isNaN({}) // true | |
isNaN(true) // false | |
isNaN(null) // false | |
isNaN(37) // false | |
// strings | |
isNaN('37') // false: "37" is converted to the number 37 which is not NaN | |
isNaN('37.37') // false: "37.37" is converted to the number 37.37 which is not NaN | |
isNaN("37,5") // true | |
isNaN('123ABC') // true: parseInt("123ABC") is 123 but Number("123ABC") is NaN | |
isNaN('') // false: the empty string is converted to 0 which is not NaN | |
isNaN(' ') // false: a string with spaces is converted to 0 which is not NaN | |
// dates | |
isNaN(new Date()) // false | |
isNaN(new Date().toString()) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment