Function isError

  • It will determine whether the provided value is an Error or not.

    Parameters

    • value: unknown

    Returns value is Error

    Since

    1.0.0

    Example

    isError(new Error("error"));
    // => true

    Example

    isError(new RangeError("error"));
    // => true

    Example

    isError(2);
    // => false