will throw error in IE10 browser
Apparently, IE treats DOM objects and Javascript objects separately, and you can't extend the DOM objects using Object.prototype.
IE doesn't let you use a prototype that is not native..
You'll have to make a separate function (global if you want) as
function isInteger(num) {
return (num ^ 0) === num;
}
console.log(isInteger(1));