Skip to main content
Module

x/froebel/list.ts>unzip

A strictly typed utility library.
Go to Latest
variable unzip
import { unzip } from "https://deno.land/x/froebel@v0.21.3/list.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>