Unexpected token {


#1

I dont understand why I am getting this error code
// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age");
var myAge = "23";
if(myAge < 13)
{
console.log("you are allowed to play");
}
else
{
console.log("lets being")
}
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 Bieber on stage?");
var userAnswer = "Yes";
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

var userAnswer = "Yes";

Just delete this line.


#3

Now I am getting the error message "Unexpected token else"?


#4

You'll have to show me your updated code


#5

// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age");
var myAge = "23";
if(myAge < 13)
{
console.log("you are allowed to play");
}
else
{
console.log("lets being")
}
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 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.'");
}