8: unexpected identifier


I'm at exercise 9 where we need to come out with our own code

it says unexpected identifier. I can't spot my mistake yet. Can someone help? thanks :slight_smile:

var answer= prompt ("what should I eat for dinner?");
switch answer {
    case 'chicken rice':
        console.log ("a bit too much");
    case 'sushi':
        console.log ("hmm a little pricey but sounds good");
    case 'noodles':
        console.log ("alright then!");
    console.log ("ahh I'll think about it again");


switch does require brackets, just like a if condition:

case (answer){


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.