> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# zip (Functional Programming) es-toolkit

Creates a function that groups values from arrays by index. Use it with [`pipe`](https://massaman.dev/reference/fp/pipe.md).

```typescript
const result = pipe(array, zip(...arrs));
```

::: info

Prefer the original es-toolkit [`zip`](https://massaman.dev/reference/array/zip.md) in ordinary code. Use this `fp` variant when composing transformations with [`pipe`](https://massaman.dev/reference/fp/pipe.md).

:::

## Usage

`zip` groups the value at each index from the piped array and the configured arrays. If arrays have different lengths, missing values are `undefined`.

```typescript
import { pipe, zip } from 'es-toolkit/fp';

pipe([1, 2], zip(['a', 'b'])); // => [[1, 'a'], [2, 'b']]

pipe([1, 2, 3], zip(['a'])); // => [[1, 'a'], [2, undefined], [3, undefined]]
```

#### Parameters


arrsArray<readonly T[]>required

The arrays to zip with the piped array.

#### Returns

A function that maps the piped array to grouped rows by index.

```typescript
(array: readonly T[]) => T[][]
```


Source: es-toolkit

Re-exported verbatim from [`es-toolkit`](https://es-toolkit.dev/fp/reference/zip.html). Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.
