Skip to content

Function: unzip() ​

ts
function unzip(zipped): unknown[][];

Unzips an array of tuples into separate arrays. 将元组数组 unzip 为多个独立数组。

Parameters ​

ParameterTypeDescription
zippedreadonly readonly unknown[][]Array of tuples / 元组数组

Returns ​

unknown[][]

Unzipped arrays / unzip 后的数组列表

Example ​

ts
unzip([[1, 'a'], [2, 'b']])
// => [[1, 2], ['a', 'b']]

Since ​

1.2.0

Released under the MIT License.