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

x/froebel/mod.ts>zip

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

Takes multiple lists and returns a list of tuples containing the value in each list at the current index. If the lists are of different lengths, the returned list of tuples has the length of the shortest passed in list.

Examples

Example 1

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

type

<T extends unknown[][]>(...lists: T) => Zip<T>