Lesson 3 introduction to objects


#1

I have looked at the different threads about this but none helped , can someone look at this code please , let me know what i did incorrectly. The code is pasted below.

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


#2

} else {
console.log(i)
}
missing } to close loop
missing } to close function
fizzBuzz();

see hint in the above code


#3

noot sure if i followed you directives correctly however i made some changes but i am still getting an error.
here is a link to my updated code.


#4

all you had to do, was insert two closing curly bracket (}), i even told you where.


#5

okay i did that and now i am getting an "unexpected end of input" message.


#6

can you post an updated version of your code?


#7

Here it is


#8

function fizzBuzz() {
    for(var i = 1; 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)
        } // closing else
    }; // closing loop, shouldn't have a semi-colon
// no } to close the function
fizzBuzz();

#9

Thank you so, i actually needed 3 closing parentheses. It works now thanks.