...And The Good!


#1


Hi can someone please tell me what is wrong with my code?:
it prints:

FizzBuzz
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz

and tells me that:
"Oops, try again. It looks like you printed out the wrong number of items."


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


#2

@roylavrov2012,
And what did you read
01. Print out the numbers from 1 - 20


#3

Oh it worked ,thank you such, a stupid little mistake


#4

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