What is wrong with my code? It keeps saying I'm missing ) at the end of the condition but I don't see where


#1

Here is my current code. I thought it was correct based on the previous exercises:

var user = prompt("Imagine you are walking through the cold streets of Morgantown and a homeless couple covered in blood approaches you. What do you do; ask them what they want, run, or call 911 immediately?").toUpperCase();

switch (user) {
case 'ask them what they want':
console.log("You better be careful...what if they want you to kill someone?!");
break;
case 'run':
console.log("I hope you can run fast because they're right behind you!");
break;
case 'call 911 immediately':
console.log("■■■■ the police.");
break;
default:
console.log("Please pick one of the three options mentioned in the scenario...that's the only way the game is fun");
break;
if (user === call 911 immediately || user === run){
console.log("You're a smart cookie")
} else {
console.log("Restart the game and choose a different option...lol");
}
if (user !== run && user !== call 911 immediately){
console.log("ha, you gon die");
} else {
console.log("Keep going and make smart decisions");
}
};
}


#2

here is your code. I have commented where there was an error

var user = prompt("Imagine you are walking through the cold streets of Morgantown and a homeless couple covered in blood approaches you. What do you do; ask them what they want, run, or call 911 immediately?").toUpperCase();

switch (user) {
case 'ask them what they want':
console.log("You better be careful...what if they want you to kill someone?!");
break;
case 'run':
console.log("I hope you can run fast because they're right behind you!");
break;
case 'call 911 immediately':
console.log("■■■■ the police.");
break;
default:
console.log("Please pick one of the three options mentioned in the scenario...that's the only way the game is fun");
break;

// you had an error here
if (user === "call 911 immediately" || user === run){
console.log("You're a smart cookie")
} else {
console.log("Restart the game and choose a different option...lol");
}

// you had an error here
if (user !== "run" && user !== "call 911 immediately"){
console.log("ha, you gon die");
} else {
console.log("Keep going and make smart decisions");
}
}
// took out the last closing brace

But just as a side note, are you really going to trust the user to enter 'call 911 immediately' always?


#3

ADD THIS ONE TOO:
var user = prompt("Imagine you are walking through the cold streets of Morgantown and a homeless couple covered in blood approaches you. What do you do; ask them what they want, run, or call 911 immediately?").toLowerCase();

//change into lowercase then it ll be perfect.