I cant figure out whats wrong with this code


#1



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


SyntaxError: Unexpected token

for(var i = 20; i < 372384784787;i++;){
    console.log(i);
}
var t = true;
while( t === true){
    console.log("t is true");
    var t = false;
}
var r = false;
do{
    console.log("hi");
} while(r === true);


#2

Hi this line

for(var i = 20; i < 372384784787;i++;)

remove the ; after i++

Then here

var t = true;
while( t === true){
    console.log("t is true");
    var t = false;
}

this line

var t = false;

remove the var


#3

@captainarcher1

You don't need to write while(t === true), you can type just while(t).


#4

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