8/14 unexpected token


#1

My whole code is
var answer = prompt("Which is better, a Velociraptor, a T-Rex, a Dragon or a Snail?")
switch(answer); {
case 'Velociraptor':
console.log("I agree, however Dragon is my real favorite.")
break;
case 'T-Rex':
console.log("To each their own I guess.");
break;
case 'Dragon':
console.log("Awesome! I love Dragons too!");
break;
case 'Snail':
console.log("Really?")
break;
default:
console.log("Please choose from the ones provided.");
break;
}
I don't see whats wrong... and all it says is Unexpected token, doesn't even SAY a token


#2

There's your culprit. Your could just move it to the line above, which needs it.


#3

and I found it, apparently java didn't like having the ; infront of the switch(answer)


#4

thanks for the help, but I found that a little bit after I posted this, which then just gave me a major headache...