7. Help with "More practice with switch"


#1


**

Can I have some help on the correct code for my switch. Thanks.

:soccer:
**


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/1/3?curriculum_id=506324b3a7dffd00020bf661


My error message is "SyntaxError: Expected ';' "


var football player = prompt("Who's your favorite football player?","Type your player choice here");

switch(football player){
  case 'Ronaldo':
    console.log("He's really good!");
    break;
  case 'Pepe':
    console.log("Is he even a football player?");
    break;
  // Add your code here!
   default:
     console.log("I don't know who " + football player + " is. How about Ronaldo?");
}


#2

I've resolved it just needed to put "footballer" instead of "football player"


#3

@14ansahd
You will have to change your variable definition
var football player
into
var football_player
or
var footballPlayer


#4

Thanks it has worked.


#5

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