Someone tell me what i am doing wrong


#1

this is my code:

confirm ("are you ready to play, user?")
var age = prompt("what is your age, user?");
if("age > 13")
{
console.log("welcome to the game, user!");
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.'");
}
}
else
{
console.log("you are not allowed to play");
}

if i say yes i get "You and Bieber start racing. It's neck and neck! You win by a shoelace!"
but if i say no, i also get "You and Bieber start racing. It's neck and neck! You win by a shoelace!"
same with the age, if i type younger, i still get welcome in the game.


#2

Hi @ntsbenvo, you have your if conditions in parenthesis:

They should say:
if(age > 13)
if(userAnswer = "yes")

(The yes is in parenthesis because it is a string.)


#3

You mean the yes is in Quotation Marks if it is a string? Quotation Marks"" make strings, not parentheses ().