A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/lodash-_-iserror-method/ below:

Lodash _.isError() Method - GeeksforGeeks

Lodash _.isError() Method

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: Return Value:

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