Part 5, considers i typed yes no matter what


no matter what I type at the prompt, it considers i said yes. The program think I made no mistake I could technically go to the nest step but I clearly made one mistake if i can’t trigger the else no matter what i do

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!”)
console.log(“Oh no! Bieber shakes his head and sings ‘I set a pace, so I can race without pacing.’”);


"userAnswer === yes" is just a single string, there is no comparison.


i used
if(userAnswer === “yes”)
and it worked. if i dont put strings on the yes it says its not defined

works though. numbers without strings seem to be fine


you might want to do some reading about data types and data structures:


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