Simple while loop


What is wrong in the following loop? Isnt the loop supposed to end after console.log? (because 'test' gets a new bool value "false" after looping once? But insted the website is crashing i presume because its a infinite loop? or did I understand the while loop wrong?

for (i=0; i <5; i++){
--->          test = true;
                   while (test)
                       test = false;


the curly bracket around while are missing:

while (test){
  test = false;

i think the missing {} is what is causing the infinity loop


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