That line leaves the first segment in arr, and assigns the rest to tmpArr. Im really baffled as to why this doesnt work. Ive checked with console.log to see if im returning what i should and nothing seems wrong… ive checked and im definitely returning a multi dimensional array
I just want to be sure about a few things: am I allowed to declare that variable I have outside of the function in this particular exercise? I need it since I do use recursion. And also since splice() returns and leaves separate arrays, when I push any of these into my global array it should create a multi dimensional array right?