Nodejs Utililty Methods Int Value Check

List of utility methods to do Int Value Check

Description

The list of methods to do Int Value Check are organized into topic(s).

Method

isInt()
String.prototype.isInt = function() {
    if (this == "NaN")
        return false;
    return this == parseInt(this).toString();
isInteger()
String.prototype.isInteger = function() {
  return (/\d/g).test(this);
isInteger()
String.prototype.isInteger = function()
  return (/^[-\+]?\d+$/.test(this.Trim()));
isInteger(value, isString)
Number.isInteger = function isInteger(value, isString) {
    if (typeof value === "string" && isString) {
        if (value.match(/^[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?$/)) {
            return Number.isInteger(parseFloat(value, 10));
    return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
};