Javascript Sytax Problems


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

No sure why this dosent work, i will update if i find a way to fix it.
Says its a Sytax Unexpected identifier. :tired_face:


First this is the wrong area to post this. This is a javascript exercise but you posted it in the Ruby area.

One thing that I see wrong is that yes in userAnswer = yes needs to be in string format. So just add quotes to that.


Also, you can change the section of your thread by editing it.


You were right, but I got an unexpected string, and, i'm having a hard time finding it.