What's wrong 3


#1

it said that it console.logged FizzBuzz instead of 1... How do i fix this??????????

for(var i = 0; i < 20; i++){
    if( i % 3 === 0){
        if (i % 5 === 0){
            if(i === 1){
                console.log(i)
            }else{
                console.log('FizzBuzz')
            }
        } else {
            console.log ("fizz")
        }
    } else {
        if (i % 5 === 0){
            console.log('buzz')
        }else{
            console.log(i)
        }
    }
};


#2

from the instructions:

Print out the numbers from 1 - 20

you print 0-19

the problem with is that:

0 % 3 = 0
0 % 5 = 0

which is why we start at one, not at zero.


#3

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