Function isNumeric

  • Checks if a value is numeric.

    This function determines if the provided value is a number or a numeric string. It also checks for floating-point numbers.

    Parameters

    • n: unknown

      The value to check.

    Returns boolean

    • Returns true if the value is numeric, otherwise false.

    Example

    // Returns true
    isNumeric(123);

    Example

    // Returns true
    isNumeric("123");

    Example

    // Returns true
    isNumeric(1.23);

    Example

    // Returns false
    isNumeric("abc");

    Example

    // Returns false
    isNumeric({});

    Example

    // Returns false
    isNumeric(" 123 ");

Generated using TypeDoc