11. Review I cant figure out what is wrong with my codes (for/while/do)


#1

Below is the code I have. When I enter it I get the error: there was a problem with your syntax.

for (var i=5; var i<21; i+=2) {
console.log (i);
}

var condition = true;
while (condition) {
console.log ("Test number 1");
condition = false;
}

var myCondition=0
do {
console.log ("Test number 2");
} while (myCondition);


#2

The second part of it is a condition which and not a variable so there should not be a var before this.


#3

Thank you! I keep making that mistake.