And the good. keeps saying im printing wrong number of items


#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

figured it out. hopefully noone looks ha


#3

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

this seem to be worcking just fine for me
Romania


#4

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

there you go


#5

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