What is wrong in my code? Code Your Own Adventure! 5/7


#1

Whenever I submit the code i get the error "Syntax Error: Unexpected token else" and I don't know whats wrong
Here is the code
confirm("Are you aready to play?");
var age = prompt ("What is your age?");
if(age < 13)
{
console.log("You can't play this game")
}
else
{
console.log("Right then Game On")
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt ("do you want to race Justin Bieber on stage?");
if
(userAnswer = "yes");
{
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}


#2
if (userAnswer === "yes") {
//              ^        ^
//             ===     no semi-colon allowed

#3

Thank you very much it worked