Lodash - values 方法
语法
_.values(object)
创建一个包含 object 自身可枚举字符串键控属性值的数组。
参数
object (Object) − 要查询的对象。
输出
(Array) − 返回属性值数组。
示例
var _ = require('lodash');
function Foo() {
this.a = 1;
this.b = 2;
}
Foo.prototype.c = 3;
var result = _.values(new Foo);
console.log(result);
将上述程序保存在tester.js中。运行以下命令执行该程序。
命令
\>node tester.js
输出
[ 1, 2 ]

lodash_object.html