UNPKG

345 BJavaScriptView Raw
1/**
2 * @name arrayUnzip
3 * @description Splits a single [K, V][] into [K[], V[]]
4 */
5export function arrayUnzip(entries) {
6 const count = entries.length;
7 const keys = new Array(count);
8 const values = new Array(count);
9 for (let i = 0; i < count; i++) {
10 [keys[i], values[i]] = entries[i];
11 }
12 return [keys, values];
13}