9.8 All on your own


Hi, I cannot figure out what is wrong with my code. It says "Something is wrong with your syntax."

// Write your code below!
switch("Who is your vote going to?") {
    case 'trump':
        console.log("Trumpty dumpty!")
    case 'hillary':
    case 'markiplier':
        console.log("Good idea!");
        console.log ("Anything's better than Hillary!")


I don't think you have to end your switch in a break if I am not mistaken and you might be missing a } at the end


This is not the right syntax for a switch statement. If I remember the instructions correctly, you should declare a variable equal to a prompt. The user answers the prompt question and that is the input for the switch statement. @calvin.g.shaw, please share a link to the exercise so we're all on the same page.

You may find this useful:






Thanks for the link. Did you make any changes to your code? @bibleman13's suggestion to add a closing curly brace was correct.


Yes, I fixed it. Thank you guys for your help! :slight_smile:


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