....and the good (oops try again you printed fizzbuzz when you should have printed 1)


#1

why is this not working ? its (oops try again you printed fizzbuzz when you should have printed 1

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

#2

Hì read again the instruction I think they aske you to count from 1 to 20.


#3

ok got it so i changed the i to = 1 and then i > 21 thanks


#4

By

then i > 21

you mean i < 21 so your code look like that ?

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