For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/fp/unzipWith.md.

unzipWith (Functional Programming) es-toolkit

Creates a function that regroups zipped arrays and combines each position. Use it with pipe.

const result = pipe(array, unzipWith(iteratee));
Info

Prefer the original es-toolkit unzipWith in ordinary code. Use this fp variant when composing transformations with pipe.

Usage

unzipWith collects values at the same position from grouped rows, calls iteratee with those values, and returns the results.

import { pipe, unzipWith } from 'es-toolkit/fp';

pipe(
  [
    [1, 10],
    [2, 20],
  ],
  unzipWith((a, b) => a + b)
); // => [3, 30]

Parameters

iteratee(...args: T[]) => Rrequired

The function that combines values from the same position.

Returns

A function that maps zipped rows to combined values by position.

(target: readonly T[][]) => R[]
Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.