#3(And the good) Wrong number of items


#1

Why is this not working:
for(var i = 1;i <= 20;i+=1){
console.log(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");
}
}


#2

You dont need that console.log on the 3rd line. Also an else statement at the end to print out the number if its not fizzbuzz, fizz or buzz.

for(var i = 1;i <= 20;i+=1){
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);
}
}

#3

Thanks.
I misunderstood the instructions, I thought you had to print the numbers and
"Fizz" or whatever.