Skip to main content
Module

x/polkadot/util/array/zip.ts

Package publishing for deno.land/x/polkadot
Go to Latest
File

/** * @name arrayZip * @description Combines 2 distinct key/value arrays into a single [K, V] array */export function arrayZip <K, V> (keys: readonly K[], values: readonly V[]): [K, V][] { const count = keys.length; const result = new Array<[K, V]>(count);
for (let i = 0; i < count; i++) { result[i] = [keys[i], values[i]]; }
return result;}