Syntax error: unexpected identifier please help


#1


console.log("you at the gates of hell");
var user = prompt ("do you wish to continue?") .toUpperCase();
switch(user){
     case 'yes':
        console.log("you venture into the depths of hell");
              prompt ("go further or go back?");
              var yes = true;
              var  ok = true;
              if (yes || ok) {
             console.log("uh oh... you run face to face with a demon!");
             }
             else{
              console.log("go forward you lilly livered nimwit!");
             };
             break;
             
    case 'no' 
             console.log("really? you wimp.");
              prompt ("do you wish to reconsider?");
             var no = false;
             var maybe = false;
                 if(no && maybe){
                 console.log("you officially suck");
                 }
                 else{
                 console.log("Atta boy!");
                 };
                 break;  
             
    case 'maybe': 
             console.log("hurry up and pick nigga!");
             break;
                
     default:
            console.log(user + " is not a viable option, please pick one  of the options listed.");
};


#2

Hi try To remove The toUpperCase(toUpperCase())

var user = prompt ("do you wish to continue?") .toUpperCase

#3

I tried that and it didnt work


#4

 case 'no'  // here you missed :
``` 
and 
```
var user = prompt ("do you wish to continue?") .toUpperCase();  // here you did upper case the value of user

but for switch case see

case 'yes': // lower case

make sense :slight_smile:


#5

thank you so much it was just the : after no that i was missing


#6

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