Friday, February 6, 2026
HomeLanguagesJavascriptLodash _.isError() Method

Lodash _.isError() Method

The 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: This method accepts single parameter as mentioned above and described below:

  • value: This parameter holds the value to be checked for error.

Return Value: This method returns a Boolean value(Returns true if the given values is an error, else false).

Example 1: 

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: 

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 
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32490 POSTS0 COMMENTS
Milvus
126 POSTS0 COMMENTS
Nango Kala
6862 POSTS0 COMMENTS
Nicole Veronica
11983 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12073 POSTS0 COMMENTS
Shaida Kate Naidoo
6995 POSTS0 COMMENTS
Ted Musemwa
7236 POSTS0 COMMENTS
Thapelo Manthata
6946 POSTS0 COMMENTS
Umr Jansen
6931 POSTS0 COMMENTS