Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/src/enumerable.ts>Enumerable#zip

A better way to work with processes in Deno.
Go to Latest
method Enumerable.prototype.zip
import { Enumerable } from "https://deno.land/x/proc@0.20.37/src/enumerable.ts";

Zip two Enumerables together. If collections are unequal length, the longer collection is truncated.

Example

const a = range({ from: 1, until: 3 });
const b = enumerate(["A", "B", "C"]);

const result = a.zip(b);

// [[1, "A"], [2, "B"], [3, "C"]]

Parameters

other: AsyncIterable<U>

The other iterable.

Returns

The result of zipping