Skip to content

assert.Function.isError

soetas edited this page Nov 30, 2024 · 2 revisions

estdlib v0.1.2 / assert / isError

Function: isError()

isError(value): void

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

Parameters

value: unknown

The value to check

Returns

void

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

Since

0.1.2

See

source

Example

isError(new Error)
// => true

isError(Error)
// => false
Clone this wiki locally