Last active
September 21, 2016 07:05
-
-
Save kwokhou/5971995 to your computer and use it in GitHub Desktop.
JavaScript Is Number check, alternative to http://api.jquery.com/jQuery.isNumeric/
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
// Copied from http://stackoverflow.com/a/1830844 | |
function isNumber(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ìsNumber("1234") // returns true