Last Updated : 04 Sep, 2024
Lodash _.isNull() method is used to find whether the value of the object is null. If the value is null then returns true otherwise it returns false.
Syntax:_.isNull(value);Parameter:
Example 1: In this example, we are checking whether the given value is null or not by the use of the _isNull() method.
JavaScript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isNull()
// method
let gfg = _.isNull(null);
let gfg1 = _.isNull(void 0);
// Printing the output
console.log(gfg);
console.log(gfg1);
Output:
true
false
Example 2: In this example, we are checking whether the 'NaN' is null or not by the use of the _isNull() method.
JavaScript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isNull()
// method
let gfg = _.isNull(NaN);
// Printing the output
console.log(gfg);
Output:
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