Lodash _.functionsIn() Method
Last Updated :
30 Sep, 2020
The Lodash _.functionsIn() method creates an array of function property names from own and inherited enumerable properties of the given object.
Syntax:
_.functionsIn( object )
Parameters: This method accepts two parameters as mentioned above and described below:
- object: This is the object to inspect.
Return Value: This method returns an array of properties.
Example 1:
Javascript
const _ = require( 'lodash' );
function GFGfunc() {
this .Geek1 = _.constant( 'gfg' );
this .Geek2 = _.constant( 'gfg' );
}
console.log(_.functionsIn( new GFGfunc));
|
Output:
[ 'Geek1', 'Geek2' ]
Example 2:
Javascript
const _ = require( 'lodash' );
function GFGfunc() {
this .Geek1 = _.constant( 'gfg' );
this .Geek2 = _.constant( 'gfg' );
}
GFGfunc.prototype.Geek3 = _.constant( 'gfg' );
console.log(_.functionsIn( new GFGfunc));
|
Output:
[ 'Geek1', 'Geek2', 'Geek3' ]
Note: This will not work in normal JavaScript because it requires the lodash library to be installed and can be installed using npm install lodash.
Share your thoughts in the comments
Please Login to comment...