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).
14 * @param {Array} array The array of grouped elements to process.
15 * @param {Function} [iteratee=_.identity] The function to combine
17 * @returns {Array} Returns the new array of regrouped elements.
20 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
21 * // => [[1, 10, 100], [2, 20, 200]]
23 * _.unzipWith(zipped, _.add);
26 function unzipWith(array, iteratee) {
27 if (!(array && array.length)) {
30 var result = unzip(array);
31 if (iteratee == null) {
34 return arrayMap(result, function(group) {
35 return apply(iteratee, undefined, group);
39 module.exports = unzipWith;