Code your own adventure2, 5/6, unepexted token


#1

var user = prompt("Your sneaking through a bank. You here an alarm, do you want to LEAVE FIGHT or HIDE").toUpperCase();
switch(user) {
    case "LEAVE":
        var cops = prompt("Did you call the cops?").toUpperCase();
        if(!cops === YES) {
            console.log("You escape! *Phew*");
        } else {
            console.log("You called them, They caught you!");
        break;
    case "FIGHT":
        var gun = prompt("Do you have a gun?").toUpperCase();
        var shot = prompt("Are you agile?").toUpperCase();
        if(gun === "YES" && shot === "YES") {
            console.log("You kill them and escape with money!");
        } else {
            console.log("You can't beat Them!");
        }
        break;
    case "HIDE":
        var cam = prompt("Did the cameras see you?").toUpperCase();
        var noise = prompt("Do you make noise?").toUpperCase();
        break;
    default:
        console.log("That wasn't an option!")
        break;
}

#2
else {
            console.log("You called them, They caught you!");
        break;

there seems to be a missing } here.


#3

There is an error with a variable here, what does yes mean, I think you should put quotation marks around it, I rewrote that area with a minor difference, try now to go: leave, yes

var user = prompt("Your sneaking through a bank. You here an alarm, do you want to LEAVE FIGHT or HIDE").toUpperCase();
switch(user) {
case "LEAVE":
var cops = prompt("Did you call the cops?").toUpperCase();
if(!cops === 'YES') {
console.log("You escape! *Phew*");
} else {
console.log("You called them, They caught you!")
};
break;
case "FIGHT":
var gun = prompt("Do you have a gun?").toUpperCase();
var shot = prompt("Are you agile?").toUpperCase();
if(gun === "YES" && shot === "YES") {
console.log("You kill them and escape with money!");
} else {
console.log("You can't beat Them!");
}
break;
case "HIDE":
var cam = prompt("Did the cameras see you?").toUpperCase();
var noise = prompt("Do you make noise?").toUpperCase();
break;
default:
console.log("That wasn't an option!")
break;
}