5 Logical Operators - if condition


#1


5 - Logical Operators


It's saying my if statement needs to start with ( but as far as I can see it does. Any ideas?

SyntaxError: Unexpected identifier 'console'. Expected '(' to start an 'if' condition.


var user = prompt("Favourite Metal Genre").toLowerCase();

switch(user) {
   case 'black': 
   var which = prompt("atmospheric" || "finnish");
       if(which === 'atmospheric') {
           console.log("Me too!");
       } else {
           console.log("I also like Finish Black Metal.");
       }
       break;
   case 'death':
       console.log("Decent choice.");
       break;
case 'pagan':
      console.log("Awesome.");
      break;
default:
      console.log("That's not metal...");
}


#2

Can you link the exercise? It might be an issue with your code disagreeing with the instructions.


#3

Hey, I ended up just erasing it all and starting from scratch and it was fine. Not sure what the original problem was but...


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.