What is wrong with my code?


#1

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

Unexpected token else.

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.' ");
}


#2

this line:

if(userAnswer === "yes");

the semi-colon prevents the if clause from working properly, causing problems with else. Remove the semi-colon


#3

Thanks so much :slight_smile: I really appreciate it, my code works now


#4