4.17.11
3.10.1
2.4.2
1.3.1

_.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

argument
array
[iteratee=_.identity]
type
Array
Function
description
The array of grouped elements to process.
The function to combine regrouped values.

Returns

(array)

Example

var zipped = _.zip(
  [1, 2],
  [10, 20],
  [100, 200]
);
// => [[1, 10, 100], [2, 20, 200]]

_.unzipWith(zipped, _.add);
// => [3, 30, 300]
var zipped = _.zip([1, 2], [10, 20], [100, 200]);
// => [[1, 10, 100], [2, 20, 200]]

_.unzipWith(zipped, _.add);
// => [3, 30, 300]