value | parseInt(value) | +value | value|0 |
---|---|---|---|
0 | 0 | 0 | 0 |
10 | 10 | 10 | 10 |
10.9 | 10 | 10.9 | 10 |
-1 | -1 | -1 | -1 |
-1.9 | -1 | -1.9 | -1 |
'10' | 10 | 10 | 10 |
'ten' | NaN |
NaN |
0 |
null |
0 | NaN |
0 |
undefined |
NaN |
NaN |
0 |
Last active
August 29, 2015 14:23
-
-
Save j1mmie/bd674a9f2cd843fe297e to your computer and use it in GitHub Desktop.
Javascript int parsing cheatsheet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment