When to use while loop or for loop


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

Can someone please help me?


I hope this will help you


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).