Function isFinite

  • Checks if value is a finite number.

    Parameters

    • value: unknown

      The value to check.

    Returns value is number

    Returns true if value is a finite number, false otherwise.

    const value1 = 100;
    const value2 = Infinity;
    const value3 = '100';

    console.log(isFinite(value1)); // true
    console.log(isFinite(value2)); // false
    console.log(isFinite(value3)); // false