Skip to content

Instantly share code, notes, and snippets.

@corse32 corse32/zip.js
Created Mar 23, 2018

Embed
What would you like to do?
Variable Arity Array Zip
function zip() {
const [arr1, ...rest] = arguments
return arr1.map((e, i) => [e, ...rest.reduce((accum, arrN) => [...accum, arrN[i]], [])])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.