4. Switch Help, I'm having a problem with my code


Here is my code:

var firstConfirm = confirm("You live in Gotham city.")
var user = prompt("You are walking around Gotham city and out of nowhere BATMAN leaps out. Do you want to FIGHT him, TALK to him or RUN away from him?(Just type the fist word of the option you want to do. ) ").toUpperCase();

switch (user){

case 'FIGHT': 

case 'TALK':

    case 'RUN':
        console.log(" okay run");

        console.log("You can't" + user " Batman");


The error message I receive is:
SyntaxError: missing ) after argument list
(I plan to add more to my code, I'm just running into a problem. )

All help is appreciated Thanks in advanced.


You have to put a + if adding a variable to a string, this goes both ways...

so your default statement should be:

    console.log("You can't" + user + " Batman");


Thanks a ton, this helped a lot!