What am I doing wrong? 3/33 And the good


#1

for (var i = 1; i < 21; i++);

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

All it does is print out "Fizz"


#2

@lilianana
You have syntax issues. Here is my code. You can compare.

for (var 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);
    }
}

Enjoy )))