.unzipWith(array, [iteratee=.identity])
This method is like _.unzip
except that it accepts iteratee
to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group: (…group).
Since
3.8.0
Arguments
array
(Array): The array of grouped elements to process.[iteratee=.identity]
(Function)_: The function to combine regrouped values.
Returns
(Array): Returns the new array of regrouped elements.
Example
var zipped = _.zip([1, 2], [10, 20], [100, 200]);// => [[1, 10, 100], [2, 20, 200]]_.unzipWith(zipped, _.add);// => [3, 30, 300]
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .