Lodash - functionsIn method


Advertisements

Syntax

_.functionsIn(object)

Creates an array of function property names from own and inherited enumerable properties of object.

Arguments

  • object (Object) − The object to inspect.

Output

  • (Array) − Returns the function names.

Example

var _ = require('lodash');
 
function Foo() {
   this.a = _.constant('a');
   this.b = _.constant('b');
}
 
Foo.prototype.c = _.constant('c');
console.log(_.functionsIn(new Foo));

Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

Output

[ 'a', 'b', 'c' ]
lodash_object.htm
Advertisements