Skip to content

zipObjectDeep

js
_.zipObjectDeep([props=[]], [values=[]])

此方法与 _.zipObject 类似,不同之处在于它支持属性路径。

¥This method is like _.zipObject except that it supports property paths.

新增于

¥Since

4.1.0

参数

¥Arguments

  1. [props=[]] (数组):属性值。

    ¥[props=[]] (Array): The property identifiers.

  2. [values=[]] (数组):语义版本号。

    ¥[values=[]] (Array): The property values.

返回

¥Returns

(对象):返回新对象。

¥(Object): Returns the new object.

示例

¥Example

js
_.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
// => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }

Lodash v4.17 中文网 - 粤ICP备13048890号