Lodash _.isUndefined() Method
Last Updated :
20 Oct, 2023
Lodash _.isUndefined() method is used to find whether the given value is undefined or not. It returns True if the given value is undefined. Otherwise, it returns false.
Syntax:
_.isUndefined(value);
Parameters:
- value: This parameter holds the value to check.
Return Value:
This method returns true if the value is undefined, else false.
Example 1: In this example, we are printing the boolean result of whether the given value is undefined or not by the use of the _.isUndefined() method.
Javascript
const _ = require( "lodash" );
console.log(_.isUndefined( null ));
console.log(_.isUndefined(void 0));
console.log(_.isUndefined( 'gfg' ));
|
Output:
false
true
false
Example 2: In this example, we are printing the boolean result of whether the given value is undefined or not by the use of the _.isUndefined() method.
Javascript
const _ = require( "lodash" );
console.log(_.isUndefined(10));
console.log(_.isUndefined(undefined));
|
Output:
false
true
Share your thoughts in the comments
Please Login to comment...