When to 'while' and when to 'for'


I don't understand what I did wrong can someone show me, please. It's not crashing so I know it's not infinite.


Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected token }

var chair = true
while(chair) {
    console.log("Ugh work already");
chair = false
for (var i = 1; i < 1000; i+= 50) {


Remove a closing curly brace between the while loop and the for loop.


Wow that worked I would have never seen that thank you!


Just check for extra parenthesis and curly braces ALWAYS, especially if it gives that error.


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