The is something wrong with my else statement I can't figure it out and it's driving me bonkers!


syntaxError:Unexpected token else

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


at the end,

You do not need the semicolon.


I tried deleting the semicolon and that didn't change anything. All of my other else statements work except this one.


Your code looks fine...
The format is not the best, but it should work. Maybe just fix it a little bit

else should not be indented inside of the if statement. Additionally, I would go ahead and put the closing curly brace for the if statement on the next line, before the else. Make sure that your if and else match up, I guess.


Thanks. I feel stupid.


Don't! I'm glad you got it to work. :slight_smile:


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