Skip to content

Instantly share code, notes, and snippets.

@thewinterwind
Last active December 26, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewinterwind/7149045 to your computer and use it in GitHub Desktop.
Save thewinterwind/7149045 to your computer and use it in GitHub Desktop.
Check if a number is an integer in Javascript using jQuery (author: Anthony Vipond)
/**
* Check if a number is an integer using jQuery
* @param {Number} num
* @return {Boolean}
*/
function is_integer(num) {
return $.isNumeric(num) && !(num % 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment