Date

“Array” Methods

_.zipObject([props=[]], [values=[]])

source npm package

This method is like _.fromPairs except that it accepts two arrays, one of property identifiers and one of corresponding values.

引入版本

0.4.0

参数
[props=[]] (Array) : The property identifiers.
[values=[]] (Array) : The property values.

返回值
(Object) : Returns the new object.

示例
_.zipObject(['a', 'b'], [1, 2]);
// => { 'a': 1, 'b': 2 }