Function isError

  • Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError object.

    Parameters

    • value: any

      The value to check.

    Returns value is Error

    Returns true if value is an error object, else false.

    5.6.0

    isError(new Error)
    // => true

    isError(Error)
    // => false