[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Array](https://evolu.dev/docs/api-reference/common/Array) › zipArray

## Call Signature

```ts
function zipArray<T>(
  arrays: T,
): readonly [Readonly<ZipArrayResult<T>>, Readonly<ZipArrayResult<T>>];
```

Defined in: [packages/common/src/Array.ts:871](https://github.com/evoluhq/evolu/blob/ca15b4661c40fedb9f47434497086039cbdea38e/packages/common/src/Array.ts#L871)

Combines multiple arrays into an array of tuples.

Uses "shortest" mode — stops at the shortest input array. Preserves non-empty
type when all input arrays are non-empty. See the
[TC39 Array.zip proposal](https://github.com/tc39/proposal-array-zip)
for the pattern this follows.

### Zipping to the shortest input

```ts

const pairs = zipArray([
  [1, 2, 3],
  ["a", "b", "c"],
]);
expect(pairs).toEqual([
  [1, "a"],
  [2, "b"],
  [3, "c"],
]);
expect(
  zipArray([
    [1, 2],
    ["a", "b", "c"],
    [true, false],
  ]),
).toEqual([
  [1, "a", true],
  [2, "b", false],
]);
expectTypeOf(pairs).toEqualTypeOf<
  NonEmptyReadonlyArray<Readonly<[number, string]>>
>();
```

## Call Signature

```ts
function zipArray<T>(arrays: T): readonly Readonly<ZipArrayResult<T>>[];
```

Defined in: [packages/common/src/Array.ts:875](https://github.com/evoluhq/evolu/blob/ca15b4661c40fedb9f47434497086039cbdea38e/packages/common/src/Array.ts#L875)

Possibly empty arrays.