Plese help with the syntex


#1

can someone plwase tell me what am i missing here?

>  var user = prompt("who sent you here?").toLowerCase();

> switch(user) {
>     case 'no one':
>         var alone = prompt("are you alone?").toLowerCase();
>         var phone = prompt("are you sure you want to come in here?").toLowerCase();
>         if (alone === 'yes' && phone === 'yes') {
>             console.log("go in, from now on i cant help you");
>         } else {
>             console.log("come back tommorow when you are ALONE, and willing to go in.");
>         }
>         break;

>     case 'my friend':
>         var who = prompt("whats his name?").toLowerCase();
>         if (who === "erez" || "omer" || "no one" || "rainmaker") {
>             console.log("let me get him for you, stay here");
>         } else {
>             console.log("i dont know any members by that name, this is a private club,
>         please go away.");
>         }
>         break;

>     case 'you did':
>         console.log("i dont know you man")
>         break;

>     case 'my brother':
>         var name = prompt("whats your name?").toLowerCase();
>         if (name === "niko" || "nick" || "neo" || "nicka") {
>             console.log("you may enter " + name + ", but from now on i cant help you");
>         } else {
>             console.log("i dont know you or your borther. now go away.")
>         }
>         break;

>     default:
>         console.log("turn around now, or there will be no way back");

> };

the error is "SyntaxError: Unexpected token ILLEGAL"


#2

You code is correct, just make please go away part of the string

var user = prompt("who sent you here?").toLowerCase();

switch(user) {
case 'no one':
var alone = prompt("are you alone?").toLowerCase();
var phone = prompt("are you sure you want to come in here?").toLowerCase();
if (alone === 'yes' && phone === 'yes') {
console.log("go in, from now on i cant help you");
} else {
console.log("come back tommorow when you are ALONE, and willing to go in.");
}
break;

 case 'my friend':
     var who = prompt("whats his name?").toLowerCase();
    if (who === "erez" || "omer" || "no one" || "rainmaker") {
        console.log("let me get him for you, stay here");
     } else {
         console.log("i dont know any members by that name, this is a private club,please go away.");
     }
     break;

 case 'you did':
     console.log("i dont know you man")
     break;

 case 'my brother':
     var name = prompt("whats your name?").toLowerCase();
     if (name === "niko" || "nick" || "neo" || "nicka") {
         console.log("you may enter " + name + ", but from now on i cant help you");
     } else {
         console.log("i dont know you or your borther. now go away.")
     }
     break;

 default:
     console.log("turn around now, or there will be no way back");

};


#3

thank you so much man! ive tried litetly everything!