zipWith source npm

_.zipWith([arrays], [iteratee=_.identity])

This method is like _.zip except that it accepts iteratee to specify how grouped values should be combined. The iteratee is invoked with four arguments: (accumulator, value, index, group). The first element of each group is used as the initial accumulator value.

Arguments

  1. [arrays] (...Array)

    The arrays to process.

  2. [iteratee=_.identity] (Function)

    The function to combine grouped values.

Returns (Array)

Returns the new array of grouped elements.

Example

_.zipWith([1, 2], [10, 20], [100, 200], _.add);
// => [111, 222]