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

x/froebel/mod.ts>zipWith

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

Same as zip but also takes a zipper function, that is called for each index with the element at current index in each list as arguments. The result of zipper is the element at current index in the list returned from zipWith.

Examples

Example 1

const sums = zipWith((a,b) => a+b, [1,2,3], [4,5,6])
console.log(sums) // prints: [5,7,9]

type

<T extends unknown[][], U>(zipper: (...args: Zip<T>[0]) => U, ...lists: T) => U[]