Switch-4


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: expected expression, got end of script
Oops, try again.
There was a problem with your syntax.


var user = prompt("What is your name?");
 var answer = prompt("Nice ta meet ya! You've been drafted to fight..something. Some folk say its a wyvern. Whether you believe those rumors or not if your choice. Anyways what are you most skilled in? SWORDS, BOW&ARROWS, or MAGYKS?");
 
 switch(user) {
     
    case 'SWORDS':
        console.log("Ya prefer it up close and personal eh? I like ya! Anyways head up to the Town Square and get a Enchantyed sword and shield.");
        break;
    case 'BOW&ARROWS':
        console.log("I hope ya have a good shot chap! Now go to the Town Square and get an Enchantyed bow with some arrows!");
        break;
    case 'MAGYK':
        console.log("A bit of Hocus Pocus, eh? Head upto the Town Square and get an Enchantyed Magyk cloak!");
        break;
    default:
        console.log("Whatcha gonna do chap?! run around naked singing the creature to the underworld?! Pick a role now!");



am I missing something or did I accidentally put in some extra? Please Help!


#3

You need a corresponding curly bracket closing your switch statement.


#4

Thanks! Lol it was so simple..xD


#5

np, I'm glad to help :slight_smile:


#6

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