Browsers Crashes - No infinite Loop


Hi, after submitting intentionally an infinite loop to se what happens, codeacademy keeps crashing the browser, despite there is no infinite loop. Funny thing, the exercise that crashes the browser is the one following, not the one I submitted the infinite loop

Also, next exercises crash the browser

So far I have tried:

  • Refresh tab and close whole window

  • Log with a different chrome user and log from safari

  • Reset code in previous exercises and rewrite code

  • Skip a couple of exercises, and continue

None of them have worked so far

The exercise that crashed browser is "A fellow infinite loops"; now I fixed the code and I can submit and pass the exercise, but browser crashes in next exercise "Brevity is the soul of programming".

Looking forward for your response. Thanks in advance



This is also an infinite loop.

where you have while(bool = true)

make that just while(bool){


Thanks, I've been stuck for a week. Although I don't understand why is an infinite loop, since after console.log I close with bool = false



The problem is that you were using the assignment operator "=" when checking the condition for the while loop, rather than the comparison operator "===".

If you were to use while(bool === true) you could expect to code to work without an infinite loop as well.



Thats not true, that still creates an infinite loop.

Just tried it in jsbin and it still crashed the browser, assigning === to all of the times you use bool gives an error.


Just to confirm, does your code look similar to the following:

var bool = true;

while(bool === true){
console.log("Infinite loop?");
bool = false;

Just want to confirm, because it does not cause an infinite loop when I run in Jsbin.


Nevermind you're code works I take it back.

As byteslayer said

would be fine to use.