import { zip } from "https://deno.land/std@0.113.0/collections/mod.ts";
Builds 2-tuples of elements from the given array with matching indices, stopping when the smaller array's end is reached
Example:
import { zip } from "https://deno.land/std@0.113.0/collections/mod.ts";
import { assertEquals } from "https://deno.land/std@0.113.0/testing/asserts.ts";
const numbers = [ 1, 2, 3, 4 ]
const letters = [ 'a', 'b', 'c', 'd' ]
const pairs = zip(numbers, letters)
assertEquals(pairs, [
[ 1, 'a' ],
[ 2, 'b' ],
[ 3, 'c' ],
[ 4, 'd' ],
])