⬅︎ Back to isInt() JavaScript function
how about this:String.prototype.isInt = function(){ var re = new RegExp("^[\d]+$"); return this.match(re);}
that will fail for negative numbers.
Comment
how about this:
String.prototype.isInt = function()
{
var re = new RegExp("^[\d]+$");
return this.match(re);
}
Replies
that will fail for negative numbers.