Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/proc/mod3.ts>Enumerable#unzip

A better way to work with processes in Deno.
Go to Latest
method Enumerable.prototype.unzip
Re-export
import { Enumerable } from "https://deno.land/x/proc@0.20.34/mod3.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.