Technical problem - Mutation - Forever Loop?

Hi there,

While doing the Mutations algorithm, I think I may I produced an infinite loop… I can’t touch the code anymore and it is forever loading. Tried the “run=disable” into URL but didn’t change anything.

Here is what my code looks like. I figure out that I need a “for” loop now, but I can’t even write on the code. Would there be a way to arrange that ? Did anyone had the same issue ? How did you solve that ? (I am giving myself comments memory of former algorithm that could resemble the code, they have nothing of interest)

Have you tryed the RESET button on the page?
It resets the page deleting your code.

Your WHILE condition is the cause of the neverending loop: i is always minor than a string that’s different from 0. And in your loop it seems that you don’t modify the i either the testedString.length, so this condition will never change. You have to increment i to let it arrive to the string length value.

repl.it now has infinite loop protection … which means you can write code and if it has a infinite loop it will just stop and you dosent crash your browser … and what makes it handier is then you can put console.logs in and this helps you figure out where the problem is. It also allows you to turn the infinite loop protection on and off …
so its very handy for trying your code before you do it on fcc

1 Like

Thanks for the replies and the tip for repl.it, will use it for next algorithms.

For the mutations one though, none of that is sadly working.

I can’t even clic on anything on the page when i get the code loaded…

I just tried run=disable, it works fine now. :slight_smile:
Thanks.