When i say no the aswer still the same


#1


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

If the condition-expression doesn't evaluate to a Boolean, it is converted to boolean.

> userAnswer = '534tnh5'
'534tnh5'
> Boolean(userAnswer = "yes")
true

As you can see your expression evaluates to true when converted to Boolean. What if it's not converted?

> userAnswer = "yes"
'yes'
> Boolean('yes')
true

Your expression does not compare userAnswer with the string "yes", it does something else. What is the = operator used for?

Documentation for = :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Assignment


#3

I think you did the same mistake as I .
(userAnswer === "yes") you must use === for this exercise!
because = is for assigning like x=23 but you use === if two things are equal:relaxed: