Simple function to verify if a number is integer
In ES6, the next version of Javascript, there will be a function exactly for this purpose called Number.isInteger(). Currently, MDN offers the following polyfill which I assume therefore does the best Javascript can to determine whether something is an integer. There are edge cases of course, but for most everyday use it will do the trick:

Number.isInteger = Number.isInteger || function(value) {
    return typeof value === "number" &amp;&amp; 
           isFinite(value) &amp;&amp; 
           Math.floor(value) === value;
};


I think this is the best we will do in the meanwhile, as passing string to a number function is an effective way of doing it, but calling toString on a number makes it go through conversion as well, resulting in potential issues.

There are already a couple of browsers that support it like Chrome and Firefox, but the big one (Safari) doesn't yet and neither does IE/Edge, so the polyfill will have to do. For more info, see MDN's writeup, it's quite insightful:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Browser_compatibility

Note: Polyfills like this are useful, but there are some concerns about amending these core features of JS. As I say in the comments, as long as you implement something that doesn't exist or replace anything, I think it's alright. Use in moderation.

You can always wrap it in it's own function and call it as a global function if you prefer not to use this polyfill.