11/11


#1

Helllo.Console says "ErrorSyntyax : Unexpected token ="
My code is this :

    for (var = i; i < 11; i++) {
        console.log(i);
    }
        var loopCondition1 = true;
        while(loopCondition1) {
    console.log("Hello");
    loopCondition1 = false;
    }
    var loopCondition2 = false;
    do {
        console.log("World");
    } while(loopCondition2);

What should i do and why?


#2

Hi here

 for (var = i; i < 11; i++) {

You put var = i instead of var i = 0


#3

Thanks a lot man.But why not var?


#4

var is the keyword to declare a variable, so you cannot assign a value to this keyword. But what you could and should do is declare a variable var name and assign a value to this variable e.g. var i=0


#5

Don't fully understand but thanks.