Function isNum

  • Checks if a given value is a non-empty string representation of a number.

    Parameters

    • n: unknown

      The value to be checked.

    Returns boolean

    Returns true if the value is a non-empty string representation of a number, otherwise false.

    Example

    const result1 = isNum(123); // false
    const result2 = isNum("123"); // true
    const result3 = isNum("abc"); // false

Generated using TypeDoc