Code Your Own Adventure .07


#1

Im not Really stuck. But there seems to be something wrong with my code, when i get to the "race justin Question" the outcome stays positive no matter what i type in. Any idea what could be wrong?

confirm("Lock 'n Load!") 
{
var age = prompt("Whats your age?");
}
if(age>13) 
{
console.log("carry on Stalker");
}
else
{
console.log("get out of here Stalker!");
}
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//it seems like this "else" line is not working properly 
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'")
}
var feedback = prompt("Rate my code on a scale of 1-10");
if(feedback>=8)
{
console.log("Thank you! We should race at the next concert!"); 
}
else
{
console.log("I'll keep practicing coding and racing.");
}

#2

ok sorry guys already got the answere i did need to replace the

if(userAnswer="yes")

with

if(userAnswer==="yes")