FizzBuzz


#1


https://www.codecademy.com/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: Unexpected end of input


var numbers = function(){
    for (i=1; i<=20; i++){
        if(i%3===0 || i%5===0){
            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

Definition of the function is not closed, you have to add }; at the end of the script.


#3

Thanks. But now it returns me " It looks like you printed out the wrong number of items."


#4

You need to execute your function:

numbers();

#5

One thing that helps a lot in such cases is to copy your code, open the console in your browser (right click - inspect and go to the console) and paste your code, press enter to run it and look at the error, the console tells you where your mistake is.


#6

Thank you for the advice!


#7

thanks great advice this advice help me a lot


#8

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