Created
March 5, 2014 07:48
-
-
Save oxUnd/9362892 to your computer and use it in GitHub Desktop.
code snippet
This file contains hidden or 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
isNumeric: function( obj ) { | |
// parseFloat NaNs numeric-cast false positives (null|true|false|"") | |
// ...but misinterprets leading-number strings, particularly hex literals ("0x...") | |
// subtraction forces infinities to NaN | |
return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment