Javascript Code Your Own Adventure!


#1

For lesson 5 here is my code:
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.'");
}
I am receiving an error that's saying "Oops, try again. Did you add an if statement to your code?"
Been stuck for a while and can't seem to fix it can someone help ASAP!!
Thank you


#2

Can I see the rest of your code?
You should have your codes from the previous steps.
confirm(step 1), age prompt(step 2), age if/else(step 2), and the 2 console.logs from steps 3&4.


#3

Change the y in yes to capital letter --> "Yes"

See full below:

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.'");
}

#5