3... And the good


#1



https://www.codecademy.com/en/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: Unexpected token else


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


#2

Try this code instead:

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

        else if (i%5 === 0 && i%3 !== 0) {
            console.log("Buzz");
        }

        else if (i%5 === 0 && i%3 === 0) {
            console.log("FizzBuzz");
        }
        else {
           console.log(i); 
        }
    }

#3

Thank you, it works now.