3...and the good "FizzBuzz" issue


#1

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

I am receiving this error message for the below code: SyntaxError: missing before statement

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

Appreciate the help.


#2

else if are two seperate words, that should resolve your current error message

for some reason in this line:

elseif(i%3===0&&i%5===0);

you have a semi-colon at the end, rather then a opening curly bracket ({)

the console.log|() at the beginning of your loop will cause that too much is logged to the console, remove it

a number which is divisble by 3 and 5 is also divislbe by 3 or 5, so to check if you should print fizzbuzz, should be your if condition


#3

Thank you so much for the tips. The code works!


#4