Lodash教程

Lodash functions method

语法

_.functions(object)
Creates an array of function property names from own 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(_.functions(new Foo));
Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

输出

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