Resetting a Challenge externally - I froze everything with an alert in a loop

I know, I know - I wasn’t thinking.

But basically, going through the algorithm challenges I was going through the “Factorialize a Number” and it wasn’t giving me the outputs I was expecting, so without thinking I ran an alert inside my reduce function to give me the value of my parameters.

To cut a long story short, there are too many alerts for me to get to the end and reset the code. I’ve tried waiting it out and it isn’t working. I’ve tried disabling JavaScript but then obviously the code itself doesn’t load, and I’ve even tried clearing the cache to no effect.

Is there another way to reset the code for a challenge externally to that page, so that I can avoid loading the page and my page crashing?

Maybe I am wrong but can’t you just remove the alert from the code which is inside your URL and call that?
I thought that is how the whole solution stuff works - saved in the URL.

At this point it just loads the URL for the challenge:

And freezes immediately upon loading.

How about logging in a private/incognito window, then completing the challenge there? If ever you freeze again, just close the window and try again. Then once you complete it, open a regular window, go to your profile page, load your solution, then submit it again. Not sure if that would work though.

This is what I’ve used when I do something like this - you can prevent the page from auto-running your code, so you can take out the alert. :slight_smile:

Recovering Unresponsive Code
If you have erred and incorrectly disabled loop protection and now have an unresponsive solution, you can disable Code Auto-Run.

By default, the Free Code Camp site automatically loads and runs your last recorded solution. If you have accidentally created an infinite loop or other irrecoverable error or simply don't trust the code, you can disable code auto-run by putting the following in your URL: run=disabled

Example:

URL: http://www.freecodecamp.com/challenges/Algorithm-meet-Algorithm#?solution=function%20meetBonfire(argument)

No-Run URL: http://www.freecodecamp.com/challenges/Algorithm-meet-Algorithm#?run=disabled&solution=function%20meetBonfire(argument)
1 Like

I did something similar… More then once. If you delete the browser cookies/cache that should do the trick. However, it will also remove all the code you have written in the fcc challenge.

I have never tried lindakatcodes solution. But I would try it first. It sounds awesome! That would have saved me some retyping in the past.

Disable auto-run and you’ll be able to edit your code without crashing your browser.