I am currently working with the array [1,2,3,4,5,6,7,8,9]
My goal is to achieve
[
[1],
[1,2],
[1,2,3],
[1,2,3,4],
[1,2,3,4,5],
...
]
I envision the desired outcome as
const var = array.reduce **using some form of black magic**
I attempted to use reduce and concat in my code, but I encountered issues with a 'circular object Array' error message