FizzBuzz


#1

Hi!
I'm working on the FizzBuzz exercise. (https://www.codecademy.com/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661#).
I don't see where the problem is but it won't let me pass to the next screen.
I checked it in Codepen and in the console and it works perfectly well.
Where is my mistake?
I got this message:
"Oops, try again. It looks like you printed out the wrong number of items."

Thanks for your help!

This is my code:

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

#2

you don't print anything? a function doesn't execute unless you call it.

either call the function or remove the function


#3

Oh, yes... I forgot to call it...
Thanks! :slight_smile:


#4

#5

yes, you did.

The fact that nothing displayed on the output should have been a big hint :slight_smile: