3/33 "...And the good!" - Error: Oops, try again. It looks like you printed out the wrong number of items


#1

for (i=1;i<=20;i++)

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

else { console.log (i) }

I keep getting the error "Oops, try again. It looks like you printed out the wrong number of items."
Anyone know why?


#2

Remove the else statement.


#3

Still doesn't work :frowning:

Thanks for the suggestion tho :slightly_smiling:


#4

Remove console.log(i) after for loop and keep if else statement inside bracket of
FOR loop