#3 Unexpect token ILLEGAL


#1

Here's my code:
for (var counting = 1; counting < 21; counting++)
{
switch (counting)
{
case (counting % 3 === 0 && counting % 5 === 0):
console.log("FizzBuzz")
break;
case (counting % 3 === 0):
console.log("Fizz")
break;
case (counting % 5 === 0):
console.log("Buzz")
break;
default:
console.log(counting);
}
};
It says unexpected token ILLEGAL, what's wrong with the code?


#2

hey @dberezin! Two problems. First in your defeault case be sure to end it with a colon( : ) and also in your breaks be sure to end it with a ( ; ). Hope this helped!


#3

Thanks for the help, but I'm still receiving the same error.


#4

In this exercise, I think it is supposed to use an if/else statement therefore you receive that message saying 'unexpected token illegal' because you mustn't use a switch statement.