5. The story heats up! REFERENCE ERROR! YES UNDEFINED


#1

The If statement should written as
if(userAnswer==="yes")

As 'yes' is a string it should be written inside the quotes

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


#2

Ok so this part of your code works just fine when I paste it into my code so if you could post your entire code I think from that we can solve your problem!


#3

Ma entire coding is running properly. Thanks for asking.!!


#4

Well good! Happy coding! :smiley:


#5

was this intended as a wiki/explanatory topic?


#6

sorry.. I don't know :confused:


#7

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