Friday, June 12, 2026
HomeLanguagesJavascriptLodash _.falsey() Method

Lodash _.falsey() Method

The Lodash _.falsey() method checks whether the given value is falsey or not and returns the corresponding boolean value. A falsey value is one that means false in a boolean context.

Syntax:

_.falsey( value );

Parameters: This method accepts single parameter as mentioned above and described below:

  • value: Given value is to be checked for falsey value.

Return Value: This method returns a Boolean value true if the given value is falsey, else false.

Note: This will not work in normal JavaScript because it requires the lodash.js contrib library to be installed. Lodash.js contrib library can be installed using npm install lodash-contrib.

Example 1:

Javascript




// Defining underscore lodash variable 
var _ = require('lodash-contrib'); 
  
var bool = _.falsey(false);
    
console.log("Given Value is Falsey : ", bool);


Output:

Given Value is Falsey : true

Example 2:

Javascript




// Defining underscore lodash variable 
var _ = require('lodash-contrib'); 
  
var bool = _.falsey(10);
    
console.log("Given Value is Falsey : ", bool);


Output:

Given Value is Falsey : false

Example 3:

Javascript




// Defining underscore lodash variable 
var _ = require('lodash-contrib'); 
  
var bool = _.falsey([ 1, 2, 3 ]);
console.log("Given Value is Falsey : ", bool);
  
var bool = _.falsey({});
console.log("Given Value is Falsey : ", bool);


Output:

Given Value is Falsey : false
Given Value is Falsey : false

Example 4:

Javascript




// Defining underscore lodash variable 
var _ = require('lodash-contrib'); 
  
var bool = _.falsey(false);
console.log("Given Value is Falsey : ", bool);
  
var bool = _.falsey("false");
console.log("Given Value is Falsey : ", bool);


Output:

Given Value is Falsey : true
Given Value is Falsey : false
RELATED ARTICLES

Most Popular

Dominic
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS