1 var apply = require('./_apply'),
2 arrayMap = require('./_arrayMap'),
3 unzip = require('./unzip');
6 * This method is like `_.unzip` except that it accepts `iteratee` to specify
7 * how regrouped values should be combined. The iteratee is invoked with the
8 * elements of each group: (...group).
13 * @param {Array} array The array of grouped elements to process.
14 * @param {Function} [iteratee=_.identity] The function to combine regrouped values.
15 * @returns {Array} Returns the new array of regrouped elements.
18 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
19 * // => [[1, 10, 100], [2, 20, 200]]
21 * _.unzipWith(zipped, _.add);
24 function unzipWith(array, iteratee) {
25 if (!(array && array.length)) {
28 var result = unzip(array);
29 if (iteratee == null) {
32 return arrayMap(result, function(group) {
33 return apply(iteratee, undefined, group);
37 module.exports = unzipWith;