5.The story heats up!


#1

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(userAnswer==="no")
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
When i fill in "yes",It‘s print out the console of "if" and "else",Please help me!


#2

I got it! Sorry for disturbing.remove (userAnswer="no") behind ”else“ will run correctly.


#3

This is what got me to the next section:

// Check if the user is ready to play!

var age = prompt("What's your age");
if(age < 13)
{
console.log("Sorry, you are not old enough");
prompt("Sorry");
}
else
{
console.log("You are old enough! Access Granted!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
var bieber;
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!");
prompt("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.'");
}
//prompt("Oh no! Bieber shakes his head and sings, 'I set a pace, so I can //race without pacing.'")


#4

Many many thanks to u :slight_smile:


#5

A post was split to a new topic: Why isn't this working?


#6