1 var rest = require('./rest'),
2 unzipWith = require('./unzipWith');
5 * This method is like `_.zip` except that it accepts `iteratee` to specify
6 * how grouped values should be combined. The iteratee is invoked with the
7 * elements of each group: (...group).
12 * @param {...Array} [arrays] The arrays to process.
13 * @param {Function} [iteratee=_.identity] The function to combine grouped values.
14 * @returns {Array} Returns the new array of grouped elements.
17 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
22 var zipWith = rest(function(arrays) {
23 var length = arrays.length,
24 iteratee = length > 1 ? arrays[length - 1] : undefined;
26 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
27 return unzipWith(arrays, iteratee);
30 module.exports = zipWith;