4. Brevity is the soul to programming (windows keeps crashing)


#1


https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/0/4?curriculum_id=506324b3a7dffd00020bf661


My browser keeps crashing when I shorten the code. I am not sure how to fix it :confused:


Replace this line with your code. 

var bool = true;

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


#2

Hey there.

The reason for this is because your while loop is currently coded to run indefinitely.

It will loop as long at the condition in the parentheses is true. So we need to make sure that at some point in time it is not true so that it can exit the loop.

If you add bool = false; just under the console.log you'll see what I mean.


#3

Angusbeef,

You're the real MVP. Thank you!


#4

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