When to use while loop or for loop


#1

Var understand =true;
while(understand===false) {
console.log("I think I'm getting this!");
understand=false
}
var counter
for (var counter =1; counter <11; counter++) {
console.log(counter);
}
SyntaxError: missing before statement

Can someone please help me?


#2

I hope this will help you


#3

Seems like you wrote var with an upper case V. Also understand === false isn't a good condition if the value of understand is true because then the condition is false and the loop won't run. So better use understand === true or just understand (test the cases that could happen and you'll see that for booleans they virtually do the same thing).