3/33 "Unexpected token else"


#1


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);
        }
}


#2

; after if statement is a bad idea

remove that


#3

that was the problem, thank you!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.