3. ...And the good! I got s problem with my code :`(


#1

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

--->
Oops, try again. It looks like you printed out the wrong number of items.


#2

Hi fbeug,

Keep in mind that you need to look at the number 1- 20 and not 0- 20. :wink:

Grtz


#3

Also keep in mind that the order of conditions might matter as you pick the first match. Think about the case of 15 what it is and what it should be.


#4

ok got it :smiley:
thank you :slightly_smiling:


#5
for (var 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);
    }
};