Created
August 12, 2019 13:21
-
-
Save pepijnolivier/c959badba3ceefacad183558cfce949f to your computer and use it in GitHub Desktop.
Test whether or not a variable is a number 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
function isNumber(input) { | |
return !isNaN(+input); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment