Lodash _.isFunction() Method

The Lodash _.isFunction() Method checks whether the given value is a function object or not and returns the corresponding boolean value.

Syntax:

_.isFunction( value )

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

  • value: This parameter holds the value that to be checked for a function object.

Return Value: This method returns a Boolean value(Returns true if the given value is Function object number, else false).

Example 1: 



Javascript

filter_none

edit
close

play_arrow

link
brightness_4
code

// Defining Lodash variable 
const _ = require('lodash'); 
  
function Geeks(){
    var a="gfg";
}
// Checking for Function
console.log("The Value is Function : "
        + _.isFunction(Geeks));

chevron_right


Output:

The Value is Function : true

Example 2: 

Javascript

filter_none

edit
close

play_arrow

link
brightness_4
code

// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Function
console.log("The Value is Function : "
        + _.isFunction("Function"));

chevron_right


Output:

The Value is Function : false 

Example 3: For _ object, it returns true.

Javascript

filter_none

edit
close

play_arrow

link
brightness_4
code

// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Function
console.log("The Value is Function : "
        + _.isFunction(_));

chevron_right


Output:

The Value is Function : true

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.