Getting SyntaxError: Expected ';' error


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661#

I'm getting a message about a missing ';'. I don't think it's right, but I added one after the If statement. That cleared up that error, but then I get SyntaxError: Syntax error. Again, I don't think a semicolon belongs there, but I don't see where I'm missing one. Maybe another set of eyes will find my mistake.
Thanks!


var user = prompt("What is your favorite band?").toUpperCase();

switch(user) {
  case("RUSH"):
      console.log("You obviously have good taste.");
  var drummer = prompt("Which drummer is better?").toUpperCase(); 
        If(drummer === "PEART") {
            console.log("Of course, the Professor");
        }
        else {
            console.log("John was good, but seriously?");
        }
      break;
  case("YES"):
      console.log("A fine choice, your parents would be proud.");
      break;
  case("ONE DIRECTION"):
      console.log("You are a shame to your entire family.");
      break;
  default:
      console.log("Try again.");
}


#2

Hi this line

If(drummer === "PEART")

you wrote If instead of if should be with downcase i


#3

Wow, thanks. Something so simple...
That was it, works perfectly now.
Thanks again!


#4

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