What is wrong?!


#1

it keeps saying
SyntaxError: Unexpected identifier

here is my code

var user = prompt("you see a strange jewel in the forest, do you TAKE the jewel, BRAKE the jewel, or GO AWAY? ").toUpperCase();
switch(user) {
case 'TAKE':
console.log("darkness. when you come to, you are in a prison cell. IT WAS A TRAP!!!!");
break;
case 'GO AWAY':
if(user === LEAVE IT) {
console.log("you come home and forget everything the next day. all you can remember the next day is the blury outline of a person leaning over you.")
}
else {
console.log("you come home and forget everything the next day. all you can remember the next day is the blurry outline of a person leaning over you.");
}
break;
case 'BRAKE':
console.log("you suddenly hear alarms go off and you run home unharmed. all you can remember the next day is a wailing siren.");
break;
default:
console.log("that is not a valid answer.");
};


#2

On this line you wrote

if(user === LEAVE IT) {

you have to have the quotes around LEAVE IT to make it a string or else it is a variable which is not defined

if(user === "LEAVE IT") {

#3

thank you big help!!! :grinning: