tguard-js
    Preparing search index...

    Function isError

    • Determines whether the provided value is an Error object.

      Parameters

      • x: unknown

        The value to be checked.

      Returns x is Error

      true if the value is an Error object, otherwise false.

      This function checks whether a value is an instance of Error or matches the internal [[Class]] tag of [object Error].

      This ensures compatibility across realms (e.g., iframes).

      Value Result
      new Error() true
      new TypeError() true
      { message: 'err' } false
      'error' false
      null false

      1.0