Created
March 23, 2018 01:15
-
-
Save corse32/d78770bc27490f04e94d71805f5737c6 to your computer and use it in GitHub Desktop.
Variable Arity Array Zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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