Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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