Lodash教程

Lodash functionsIn method

语法

_.functionsIn(object)
Creates an array of function property names from own and inherited enumerable properties of object.

参数

object (Object) − The object to inspect.

输出

(Array) − Returns the function names.

实例

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

输出

[ 'a', 'b', 'c' ]
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4