SyntaxError: Unexpected token )?


#1



Introduction to Objects I ...And the good


So I keep looking to see if something is wrong with my code in terms of syntax, and I can't see any problems


for (i = 1, i < 21, i++) {
    if (i % 3 === 0 && i % 5 === 0) {
        console.log("FizzBuzz");
    }
    else if (i % 3 === 0) {
        console.log("Fizz");
    }
    else if (i % 5 === 0) {
        console.log("Buzz");
    }
    else {
        console.log(i);
    }
}

Somebody please tell me where there is an end parentheses that shouldn't be there, because I can't see it anywhere.


#2

By the way, the syntax error I'm getting is that there is an unexpected token ) somewhere


#3

Hi inside your for loop

for (i = 1, i < 21, i++)

instead of , change it with ;


#4

Did you declare "i" as a variable?


#5

add "var" and use ";" not "," in your for loop

@chase_2442