Here you can find the source of isNumber()
String.prototype.isNumber = function() { try/*w w w . j a v a 2 s . c o m*/ { var value = this.toString(); value = value.replace(",",""); if (parseFloat(value)!= value) return false; else return true; } catch (err) { return false; } };
var puts = require("sys").puts; Number.square = function(n) { return n * n Number.even = function(n) { return n % 2 == 0 Number.odd = function(n) { return !this.even(n) ...
String.prototype.isNumber = function(){ return !isNaN(this); };
String.prototype.isNumber = function(){ var pattern=/^[+\-]?\d+(.\d+)?$/; flag=pattern.test(this); if(flag) return true; return false;
String.prototype.isNumber = function (){ var str = this; return !isNaN(str);
String.prototype.isNumber = function() return (/^\d+$/.test(this.Trim()));
String.prototype.isNumeric = function(){ return !isNaN(parseFloat(this)) && isFinite(this);
String.prototype.isNumeric = function() { return !isNaN(parseFloat(this)) && isFinite(this); };
String.prototype.isNumeric = function() { return !isNaN(parseFloat(this)) && isFinite(this); };
String.prototype.isNumeric = function() { var tmpFloat = parseFloat(this); if (isNaN(tmpFloat)) return false; var tmpLen = this.length - tmpFloat.toString().length; return tmpFloat + "0".Repeat(tmpLen) == this;