My Code kills the Browser

I was writing a Code for The Challange “Steamroller”.
Then suddenly it killed the whole Browser.
Now i cant open it to change it.
Any Idea what to do?

You have created infinite recursion.
FCC uses an infinite loop protection, but it can’t catch every case.
The reason that your browser crashes every time you try to load the challenge is because the code in your editor automatically runs. Try disabling auto run.
Another option is to clear the challenge data from your browser cache.

1 Like

Read the following thread on temporarily disabling the autorun feature on FCC. This will allow you to make the necessary changes to your code to prevent

The following test case causes the infinite loop (as suggested by @ArielLeslie).

steamrollArray([1, [], [3, [[4]]]])

The blank array [] gets recognized as an array by your if statement and then unwrapper is called again. Because you declared i globally instead of prefixing it with the keyword var, you end up with an infinite loop. Avoid global variables when possible.

1 Like