Skip to main content
variable unzip
import { unzip } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Creates an array of arrays, ungrouping the elements in an array produced by zip.

Note: Provide size to make calculation faster

Use Math.max.apply() to get the longest subarray in the array, Array.prototype.map() to make each element an array. Use Array.prototype.reduce() and Array.prototype.forEach() to map grouped values to individual arrays.

type

(arr: any[], size?) => unknown