Is there a neat way to destructure a 2D array to assign a variable to each column?
For example:
const matrix = [
[1,2,3,4,5],
[1,2,3,4,5],
[1,2,3,4,5]
]
const [ones, twos, threes, fours, fives] = foo(matrix);
console.log(ones);
// [1, 1, 1]
console.log(twos);
// [2, 2, 2]
etc.
Cheers,
P