Zips the given arrays together into pairs.

Type signature

(xs: any[], ys: any[]) => any[][]

Examples

zip([1, 2, 3], [4, 5, 6]);
// ⇒ [[1, 4],[2, 5],[3, 6]]
Try in REPL

Questions

  • How to zip two arrays?

TypeScript sourceJavaScript source