Justin bieber 2nd question


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

error:Oops, try again. Did you add an if statement to your code?


#2

I am having the same issue. Did you find the solution? I am getting the desired output.


#3

@rohanarihant your code seems to work just fine for me. All I did was copy and pasted what you wrote in this post and it accepted it. try refreshing your browser?


#4

but it is not working........


#5

Well @rohanarihant from your screen shot you are missing the first two thirds of your code. That could be throwing it off as well. You're supposed to be adding on to your code as you go rather than just writing the code for that particular lesson.


#6

I have a problem with this part of the question too. However, in my instructions it only asked me to use a variable called userAnswer and equal it to the prompt. nothing is mentioned about the 2nd line that rohanarihant has about equaling to yes??


#7

Hi Everyone
I am experiencing the exact same problem as @rohanarihant regarding the "yes" issue,
NB: I added up all the codes as instructed and here the bit related to the question

...
var userAnswer = prompt ("Do you want to race Bieber on stage?");
if (userAnswer === "yes") {
// Do something
console.log("Come on stage and let's play");
} else { // Otherwise...
// Do something else!
console.log("Stay where you are");
}

...
Although it prints a result, I have the following error message the error message:

...

Oops, try again.
Did you remember to put in the 'yes' answer option?

...
Should I carry on anyway?
Any suggestions?

kindest regards