tguard-js
    Preparing search index...

    Function isInteger

    • Determines whether the provided value is a finite integer number.

      Parameters

      • x: unknown

        The value to validate.

      Returns x is number

      true if the value is a finite integer.

      This function returns true only for finite numeric values that have no fractional component.

      This excludes:

      • NaN
      • Infinity
      • -Infinity
      • non-number values
      isInteger(42);    // true
      isInteger(-10); // true
      isInteger(3.14); // false
      isInteger(NaN); // false
      isInteger('42'); // false

      1.1