Skip to content

zip

Combine multiple arrays in sets

208 bytes

Usage

Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.

import * as _ from 'radashi'
const names = ['ra', 'zeus', 'loki']
const cultures = ['egypt', 'greek', 'norse']
_.zip(names, cultures)
// => [
// [ra, egypt]
// [zeus, greek]
// [loki, norse]
// ]