Javascript Sytax Problems


#1

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:


#2

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.


#3

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


#4

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