Skip to content

Instantly share code, notes, and snippets.

@corse32
Created March 23, 2018 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corse32/d78770bc27490f04e94d71805f5737c6 to your computer and use it in GitHub Desktop.
Save corse32/d78770bc27490f04e94d71805f5737c6 to your computer and use it in GitHub Desktop.
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