Nodejs Number Value Check isNumeric(iLoc)

Here you can find the source of isNumeric(iLoc)

Method Source Code

String.prototype.isNumeric = function (iLoc) {
    iLoc = ((!!iLoc) ? iLoc : 0);// w ww .j a va 2 s .  c o m
    iLoc = ((iLoc < 0) ? 0 : iLoc);
    iLoc = ((iLoc > (this.length - 1)) ? this.length : iLoc);
    var _ch = this.substr(iLoc, 1);
    var b = ( (_ch >= '0') && (_ch <= '9') );
    return b;
}

Related

  1. isNumeric()
    String.prototype.isNumeric = function(){
        return !isNaN(parseFloat(this)) && isFinite(this);
    
  2. isNumeric()
    String.prototype.isNumeric = function() {
      return !isNaN(parseFloat(this)) && isFinite(this);
    };
    
  3. isNumeric()
    String.prototype.isNumeric = function() {
      return !isNaN(parseFloat(this)) && isFinite(this);
    };
    
  4. isNumeric()
    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;
    
  5. isNumeric()
    var postfixStack = new Array
    String.prototype.isNumeric = function() {
        return !isNaN(parseFloat(this)) && isFinite(this);
    function MathSolver() {
    this.infixToPostfix = function(infix) {
     for(var i = 0; i < infix.length; i++) {
                var token = infix[i];
                if(token.isNumeric()) {
    ...
    
  6. isNumeric(value, isString)
    Number.isNumeric = function isNumeric(value, isString) {
        if (typeof value === "string" && isString) {
            return Number.isInteger(value, true) || Number.isFloat(value, true);
        return Number.isInteger(value) || Number.isFloat(value);
    };