The story heats up! - please help me!


#1

The story heats up! - please help me!

// Check if the user is ready to play!
confirm("are you ready to play?");
var age = prompt("what is your age?");
if(age < 13)
{
console.log("you may play, but I take no responsibility.");
}
else
{
console.log("you are old enough to play!");
}
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(answer === "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.'");
}

if you can find any typos, errors, ext., it would be great if you could help!


#2

answer? have you made a variable called answer anywhere? Or is it called something else?


#3

I believe you have called the variable userAnswer.


#4

Should be if(userAnswer === "yes")

Because you declared var userAnswer - not var answer .


#5

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