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


#1


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


#2

at the end,

You do not need the semicolon.


#3

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


#4

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.


#5

Thanks. I feel stupid.


#6

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


#7

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