3....and the good


Replace this line with your code.


This isn't working for me and I'm not really sure what I'm missing

for(var i = 1; i <= 20; i++){
if(i % 3===0){
else if(i % 5===0){
else if(i % 3===0 && i % 5===0){


agree with me that when the if condition evaluates to true, the rest of the conditions (else if and else) are not getting evaluated and the loop is moving on to the next number?

this means for 15 (which should print fizzbuzz) prints fizz because your if condition is true

checking if a number is fizzbuzz should be your if condition


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.