Steamroller InterMediateAlgorithm

why are you using a global variable?

add another
steamrollArray([1, {}, [3, [[4]]]]);
to your code and you’ll see what’s wrong;