Don't understand where I am going wrong here


#1

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


SyntaxError: Invalid or unexpected token


var user = prompt("What is your favorite sport? Football, Baseball, or Basketball?").toUpperCase();

switch(user) {
    case 'FOOTBALL':
        var oakland = prompt("Are you from the bay Area?").toUpperCase();
        var hate = prompt("Do you despite the Niners?").toUpperCase();
        if ( oakland === "YES" && hate === "YES") {
            console.log("Let's go Raiders!");
        } else {
            console.log("Your team sucks!");
        }
        break;
    case 'BASEBALL':
        var going = prompt("Are you going to the game?").toUpperCase();
        var ticket = prompt("Do you have an extra ticket?").toUpperCase();
        if (going === "YES" || ticket === "YES") {    
            console.log("Take me out to the ball game!");
        } else {
            console.log("What channel is the game on?);
        }
        break;
    case 'BASKETBALL':
        var jump = prompt("Can you jump very high?").toUpperCase();
        var point = prompt("Can I play point guard?").toUpperCase();
        if (jump === "YES" && point === "YES") {
            console.log("Alley-Oop!");
        } else {
            console.log("Shoot the three!");
        }
        break;
    default:
        console.log("Please choose one of the three options.");
};


#2

Check this case:

case 'BASEBALL':
        var going = prompt("Are you going to the game?").toUpperCase();
        var ticket = prompt("Do you have an extra ticket?").toUpperCase();
        if (going === "YES" || ticket === "YES") {    
            console.log("Take me out to the ball game!");
        } else {
            console.log("What channel is the game on?); // you forgot "
        }
        break;

#3

Wow! I was trying for so long to figure this out, lol. Thank you!


#4

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