What is it I dont see wrong here?

Both the description was weird, little informative, and the code itself produces an error that I dont understand why…

Help appreciated!

when you do arr = arr.shift() you are overwriting arr, it’s not an array anymore, so you can’t use push on it