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

x/proc/mod.ts>Enumerable#unzip

A better way to work with processes in Deno.
Latest
method Enumerable.prototype.unzip
Re-export
import { Enumerable } from "https://deno.land/x/proc@0.22.1/mod.ts";

Unzip a collection of [A, B] into Enumerable<A> and Enumerable<B>.

Note that this operations uses tee, so it will use memory during the iteration.

Example

const [a, b] = enumerate([[1, "A"], [2, "B"], [3, "C"]]).unzip();

// a is number[] -> [1, 2, 3]
// b is string[] -> ["A", "B", "C"]

Returns

Two enumerables, one for the left side of the tuple and the other for the right.