Help! and the good (FizzBuzz)


Help, please can anyone show me what is wrong?
It keep showing me this
Oops, try again. It looks like you printed out the wrong number of items.

var FizzBuzz = function() {
    for(var i = 1; i <= 20; i++) {
        if ((i % 3 === 0) && (i % 5 === 0))
            else if (i % 3 === 0)
                else if (i % 5 === 0)


You just need to call the function!
At the end of your code, (outside of the function), call it by running FizzBuzz()

Hope this helps. :slight_smile:


Thanks so much Kyleaw, It helped:grinning:


Quick question Kyleaw, I know you can go on to the next part if you just start off with "for(....etc" instead of making it a function.

Is it better practice to make it a function or either way it doesn't matter?


Variable names cannot start with capital letters?


You don't have to make a function, the exercise never asks for it

In such a simply program, i don't see why a function would be needed

@codiusy, variable names can start with capital letter, the question is, why would you?


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