Problem, as an interviewer would state it:
"Implement zip(...arrays) — combining multiple arrays into a single array of grouped tuples, where the Nth tuple contains the Nth element from every input array, matching lodash's own well-known _.zip behavior."
Examples:
zip([1,2,3], ["a","b","c"]); // [[1,"a"], [2,"b"], [3,"c"]]
Clarifying questions expected:
- What should the real, correct output length be if the input arrays have DIFFERENT lengths?
- For a shorter array, what value should genuinely appear in the tuple slot beyond its own length?
- Does this need to support any number of input arrays, or just exactly two?
Code / implementation expected: Yes — real, direct proof zipping equal-length arrays, zipping unequal-length arrays (confirming the missing slot is genuinely undefined), and confirming any number of input arrays is supported.