Problem with "The Story heats up!"


#1

I don`T know what I do wrong. Everytime I click save&submit Code and error shows up saying Oops, try again.
Did you add an if statement to your code? but in the console it works like it should be

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  shoelace!");
} else {
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race  without pacing.'");
}

#2

Try refreshing the page


#3

didn`t work there is still the same error showing up


#4

Please paste in your full code


#5

The rest isn`T necesarry I think


#6

I can't help you if you don't paste in the full code as this bit seems fine :slight_smile:


#7

i just passed that one and i had the same error, you need to copy the age verification from step 2 for it to validate correctly...


#8

This lesson is incorrect. A prompt returns a boolean value of true or false, not a string or literal value of yes or no.

Try "if (userAnswer === true)" or, alternatively, "if (userAnswer)".


#9

According to the documentation, https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt , "result is a string containing the text entered by the user, or null."


#10

Thank you guys for all your fast and helpful answers. I fixed the problem by copy and pasting all the stuff that I wrote in the first two tasks.:slight_smile:


#12