⬅︎ Back to isInt() JavaScript function
function isInteger(s){return (s%(parseInt(s)/Number(s)))===0;}is perfect solution (=
except when you want to consider "0" is an integer (which does)
Comment
function isInteger(s){
return (s%(parseInt(s)/Number(s)))===0;
}
is perfect solution (=
Replies
except when you want to consider "0" is an integer (which does)