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

x/froebel/mod.ts>unzip

A strictly typed utility library.
Go to Latest
variable unzip
import { unzip } from "https://deno.land/x/froebel@v0.18.0/mod.ts";

Reverse of zip. Takes a list of tuples and deconstructs them into an array (of length of the tuples length) of lists each containing all the elements in all tuples at the lists index.

Examples

const [nums, chars] = unzip([1,'a'], [2,'b'], [3,'c']) console.log(nums) // prints: [1, 2, 3] console.log(chars) // prints: ['a','b','c']

type

<T extends unknown[]>(...zipped: [...T][]) => Unzip<T>