Last Updated : 04 Sep, 2024
Lodash _.isError() Method checks whether the given value is a type of error or not and returns the corresponding boolean value.
Syntax:_.isError(value);Parameters:
Example 1: In this example, we are getting a 'true' value as a new Error is an object.
JavaScript
// Defining Lodash variable
const _ = require('lodash');
// Checking for Error Value
console.log("The Value is Error : "
+ _.isError(new Error));
Output:
The Value is Error : true
Example 2: In this example, we are getting a 'false' value as Err is not an object.
JavaScript
// Defining Lodash variable
const _ = require('lodash');
// Checking for Error Value
console.log("The Value is Error : "
+ _.isError("Err"));
Output:
The Value is Error : false
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4