3. Unexpected token else


#1

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

Why Unexpected token else?


#2

It's because of too many semi-colons. You need to remove the 3 semi-colons that are after the closing curly braces "}" after the console log. So should look something like:

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

Give that a shot and it should work no problem.