3/33 What's wrong


#1

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

it gives me error "Oops, try again. It looks like you printed out the wrong number of items."


#2

you should only print out i (the number) if it not dividable by 3, 5 (or 3 and 5), you print out the number anyway, create an else statement at the end, and insert console.log(i)

If i am very honest, i don't find this a very good implication of the fizzbuzz problem, but it works


#3

You have a bunch of syntax errors and placed some things in the wrong area. I'll just place my code here and you can compare:

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

}

#4

Thanksyou !! @d4ym0n