Checks if value is an Error object.
value
The value to check.
Returns true if value is an Error object, false otherwise.
true
false
console.log(isError(new Error())); // trueconsole.log(isError('Error')); // falseconsole.log(isError({ name: 'Error', message: '' })); // false Copy
console.log(isError(new Error())); // trueconsole.log(isError('Error')); // falseconsole.log(isError({ name: 'Error', message: '' })); // false
Alias