UNPKG

393 BJavaScriptView Raw
1// Copyright 2017-2022 @polkadot/util authors & contributors
2// SPDX-License-Identifier: Apache-2.0
3
4/**
5 * @name arrayZip
6 * @description Combines 2 distinct key/value arrays into a single [K, V] array
7 */
8export function arrayZip(keys, values) {
9 const result = new Array(keys.length);
10
11 for (let i = 0; i < keys.length; i++) {
12 result[i] = [keys[i], values[i]];
13 }
14
15 return result;
16}
\No newline at end of file