5 The story heats up!


#1

What is wrong with my code?

// Check if the user is ready to play!
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.'");
}

Message: Oops, try again. Did you add an if statement to your code?


#2

The if statement its looking for isn't that one, it's the previous one.
confirm("Are you ready to play?");
var age = prompt("What's your age");
if (age < 13) {
console.log("You can play.");
}
else {
console.log("Big baby.");
}
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.'");
}
It wants both parts of the code.


#3

Hey that was a good suggestion captain _/_

Not sure why they have not mentioned to write the previous part of code to be able to complete this part of code

Can we reach out to the dev team on this?

Many thanks for catching this.. Kudos..

Thanks


#4

In the beginning of the "code your own adventure" it instructs us not to delete or change any of the code from previous lessons cuz each lesson is a checkpoint. Notice how it runs all the codes in the editor every time you save and submit?