Like _.unzip, but you pass an iteratee that combines each regrouped column. The iteratee is invoked with the elements of each group: (...group). Since Lodash 3.8.0.
Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.unzipWith on an array. Start with this line.
Lodash
_.unzipWith(array, [iteratee=_.identity])
Call
What it does
_.unzipWith(array, [iteratee=_.identity])
Primary signature.
_.unzipWith(array)
Call with an array argument.
Prefer import unzipWith from "lodash/unzipWith" when you want a smaller bundle.
Library declarations
Lodash
_.unzipWith(array, [iteratee=_.identity])
Parameters
Parameter
Description
array
Required. Array of grouped elements (rows)
iteratee
Optional. Default identity → like unzip
Return Value
Return Value
Description
*
The value returned by _.unzipWith().
Lodash Examples
Example 1 — Official: Sum Columns With _.add
Unzip zipped rows and add each column — from the Lodash docs.
_.unzipWith(
[
[10, 100],
[20, 200],
[30, 300]
],
function () {
var vals = Array.prototype.slice.call(arguments);
var sum = 0;
for (var i = 0; i < vals.length; i++) sum += vals[i];
return sum / vals.length;
}
);
// → [20, 200]
_.unzipWith is a Lodash Array helper (since 3.8.0). It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 3.8.0+
_.unzipWith()
Available in [email protected] full builds and the lodash/unzipWith modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.unzipWithLodash 3.8.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import unzipWith from "lodash/unzipWith" for smaller builds. Pair with _.add or a custom fold.
Frequently Asked Questions
_.unzipWith(array, iteratee) regroups rows into columns (like _.unzip), then combines each column by calling the iteratee with that column’s values as arguments (...group).
No. It returns a new array of combined column results. The source is unchanged.
It behaves like plain _.unzip — each column stays an array instead of a reduced value.
zipWith merges parallel arrays with an iteratee per index. unzipWith starts from grouped rows, pivots to columns, then folds each column.
One argument per row for that column — first row’s value, second row’s value, and so on. Missing slots from short rows are undefined.
Use import unzipWith from "lodash/unzipWith" or require("lodash/unzipWith") for tree-shaking. Full build: import _ from "lodash" then _.unzipWith.