Error : Did you remember to put in the 'yes' answer option?


#1

Here is my code (and it clearly has 'yes' answer option) :
(btw before it was saying I don't have an if statment, now I don t know why it changes his mood and I supposetly don t have an 'yes' option answer anymore).
//code
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 shoe lace!");
} else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}


#2

got it worked?? an also stuck on same program


#3

well, yes I got it to work but in a nonsense way. I basically copied the whole if statement and it worked...
So :

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 shoe lace!");
} else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
if (userAnswer === "yes")
{
console.log("You and Bieber start racing. It´s neck and neck! You win by a shoe lace!");
} else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

I don't have a logic explanation for this but if you are just willing to move on instead of being stuck on that, you can give this a try. Hope it will work for you too.


#4

Hi there, I'm am also facing the same issue. When I skipped 2/5 and used the code for the next section it worked fine, but I still want to figure out how to complete this section. I had the code written correctly, copied and pasted the correct answers from some of the blogs to test it out and tried to copy and paste the same code a second time. I keep on receiving the message:
"Oops, try again. Did you remember to put in the 'yes' answer option?"

code is as follows:

var userAnswer = prompt("Do you want to race Bieber on stage?");

if (userAnswer === "yes")
{
console.log("You jump on stage and dust Bieber several strides. He falls to his knees in shame.");
}
else {
console.log("Bieber scoffs at you the same way he looks at the camera.");
}

Thanks!


#5

Can you send the url that I try again ?


#6

var age =25;
if(prompt("what is your age?")<13){
console.log("sorry you cant play!");
}else{

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.'")
}
}
copy this codes ... i have been try it out for so long ,now finally done..


#7

thanks it worked well


#8

thanks jerry_89 you solve my problem


#9

Lesson learned here is, in order to execute this have to write entire code from "Confirm" lesson to "The story heats up!" lesson as mentioned by jerry_89 above:

var age =25;
if(prompt("what is your age?")<13){
console.log("sorry you cant play!");
}else{

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

@jerry_89: Thank You


#10

Worked for me too, and I also have NO IDEA why. Oh well.