Please could someone help with the syntax?


#1

here is my code, i know i have missed out the || or but am unsure of where its to be placed.

var user=prompt("You have been bestowed a great gift of either: teleportation, invisibility or weather control, what will you choose?").toLowerCase();

switch(user){
case 'teleportation':
if("teleportation && invisibility"){
console.log("You'l never get caught!")
else{
console.log("coolest gift!");
};
break;
case 'invisibility':
console.log("lamest gift");
break;
case 'weather control':
console.log("Most powerful gift!");
break;
default:
console.log("That's not an option guy!")
};


#2

@saucyjam you need a closing brace } after this console.log statement:

console.log("You'l never get caught!")

to get rid of the syntax error.

Also, it looks like you're combining the switch and if commands. Are you trying to do "teleportation OR invisibility?"