Code Your Own Adventure 2: Logical operators; Getting SyntaxError: Unexpected token )


#1



Code Your Own Adventure 2: Logical Operators

I've reread my code a dozen times and even matched it up to the sample code at the beginning and can't find my errors.

I keep getting: SyntaxError: Unexpected token )

Can someone take a look and see if they can spot where I'm going wrong?

Thanks.

var user = prompt("What country is your favorite soccer team from? USA, Europe or No team yet.").toLowerCase();

switch(user) {
    case 'usa': 
        var teamUsa = prompt("Do you like an MLS team or the USMNT?").toUpperCase();
        var schedule = prompt("Do you want to follow every week?" (Yes, No?)).toLowerCase();
        if(teamUsa === 'MLS' && schedule === 'yes') {
        console.log("That's great, what team do you follow?");
}
        else {
            console.log("I'm not sure about that team.");
        }
        break;
        
    case 'europe':
        var euroTeam = prompt("That's great, are they Italian or English?").toLowerCase(); 
        var team = prompt("That's great, what team do you follow? Inter or Roma?").toLowerCase();
        if (euroTeam === 'italian' && team === 'inter') {
            console.log("Ecellent taste. I knew you were a good guy.");
    } else {
                console.log("Dang! So close to being friends.");
            }
        break;
        
    case 'no team yet':
    var noTeam = prompt("Great, let's find you a team!! Do you want to watch ever week? Yes or No?").toLowerCase();
    var national = prompt("Do you love the Olympics? Yes or No?").toLowerCase();
    if (noTeam === 'no' || national === 'yes') {
        console.log("Good choice. Nothing better than a World Cup.");
} else {
    console.log("Sounds like a club team might be your best bet.");
 
}
        break;
        
    default:
    console.log("Sorry. I didn't follow that. Please start over and follow the prompts.");
}


#2

i am not sure what you are doing on the line:

var schedule = prompt("Do you want to follow every week?" (Yes, No?)).toLowerCase();

i would include yes and no simple in the string which shows when you prompt the user:

var schedule = prompt("Do you want to follow every week? Yes or No").toLowerCase();

#3

That was it. I added the "Yes, No?" when I was trying to figure out my error. Guess I fixed one and created another. Thanks SO MUCH!