Skip to main content

zipWith

_.zipWith(iteratee, arrays, arrays) # Ⓢ [Ⓣ][1] Ⓝ

This method is like _.zip except that it accepts iteratee to specify



how grouped values should be combined. The iteratee is invoked with the



elements of each group: (...group).

Since​

3.8.0

Arguments​

  1. iteratee (Function): The function to combine

    grouped values.
  2. arrays (Array): The arrays to process.
  3. arrays (Array): The arrays to process.

Returns​

(Array): Returns the new array of grouped elements.

Example​

_.zipWith(
function (a, b) {
return a + b;
},
[1, 2],
[10, 20]
);
// => [11, 22]