_.entriesIn -> toPairsIn
语法:
_.toPairsIn(object)源代码链接:source
npm包链接:npm package
描述:
创建一个object对象自身和继承的可枚举属性的键值对数组。这个数组可以通过_.fromPairs撤回。如果object是 map 或 set,返回其条目。
开始版本:4.0.0
别名:\.entriesIn_
参数:
- object (Object): 要检索的对象。
返回值:
- (Array): 返回键值对的数组。
例子:
function Foo() {
  this.a = 1;
  this.b = 2;
}
Foo.prototype.c = 3;
_.toPairsIn(new Foo);
// => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)Last updated
Was this helpful?