const zip = (...arrs) =>
Array(Math.max(...arrs.map(a => a.length)))
.fill()
.map((_, i) => arrs.map(a => a[i])
)
const zap = (...arrs) =>
Array.from(
Array(Math.max(...arrs.map(a => a.length))),
(_, i) => arrs.map(a => a[i])
)
console.log(zip([1, 2, 3], [4, 5, 6], [7, 8, 9]))
console.log(zap([1, 2, 3], [4, 5, 6], [7, 8, 9]))
To embed this project on your website, copy the following code and paste it into your website's HTML: