While Loops - Browser Crashes


#1

Do you have the same problem with your browsers? I use safari and Firefox . Mine crashes all the time


#2

can you please post your code here?
If your loop is infinite this will crash your browser.


#3

I know it is an infinite loop that crashed my browser. However this is what they ask to do .

var bool = true;

while(bool){
console.log("Less is more!");
bool = false;
}


#4

I think I found the page that you were stuck on, take a look at my code:

var bool = true;

while(bool){
console.log("Less is more!");
bool = false;
}
maybe something to do with some scripts in your browser being corrupted. Sorry man I really don't know.

Your code:
var bool = true;

while(bool){
console.log("Less is more!");
bool = false;
}


#5

I kept crashing my browser because my code was wrong. The loops were infinite, That's what happens when you do not understand what the code means. Two days later I know the answer.


#6

Are you sure you have an infinite loop? Because from what I see you clearly
declared your variable false in your while loop. Also your code has exactly
the same syntax as me, and I didn't crash my browser.


#7

He want to say that the code WAS WRONG. The code he shared is CORRECT and is finite.

Let me know if I'm wrong.


#8

Never mind guys. Thanks anyway for you answers. I shared the right code but in my task I did it wrong. Just double checked. I kept doing infinite loops as I didnt understand what I was writing.


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.