I can solve this problem in a few different ways, but I am not sure if there is a more elegant way to do so.
Take an array
let foo = [1,2,3,4,5]
Is there a method using array destructuring that would work like thist:
split(array, n) =>
...
let bar = split(foo, 3)
bar[0] = [1,2,3]
bar[1] = [4,5]
I don't know n coming into the problem. I feel like this should be doable with destructuring, but the way I am reading it I do not see how to do so.