4. What is wrong with my code? It just says syntax error


This is my code:

var user = prompt("You're peacefully walking through the forest when you encounter an angry troll! Do you FIGHT, TALK, BRIBE, or RUN?").toLowerCase();
switch(user) {
case 'fight':
console.log("Ypu grab a stick and poke the troll's eye. he screams in pain.");
case 'talk':
console.log("You strike up a conversation with the troll. He asks you what kind of music you like.");
case 'bribe':
console.log("You offer the troll one of the muffins you are carrying.");
case 'run':
console.log("You run for it. the troll gives chase.");
console.log("Well, since you decided to not choose one of my options and take my advice, the troll eats you.");

I don't know whats wrong. It says SyntaxError: Unexpected end of input


You forgot an ending curly brace.


thanks a lot! it works now



Post again if you get confused! :slightly_smiling: