Syntax error part 5- code Adventure


#1

//Hi, dont know whats wrong with my syntax, says theres an unexpected identifier, that means the variable but im not sure whats wrong with it, only showing the part past intro in this question...

//The intro
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");

console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")

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

//thanks
`


#2

@20methip2,
The structure of an IF ELSE statement looks like

if ( condition ) {
   //Your code
}
else {
   //Your code
}

In a condition you use a comparison encapsulated in a pair of parenthesis ( )
using one of the so-called comparison operators

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators


#3

@leonhard.wettengmx.n
Thanks!