Coding adventure #4


#1

so ive gone over this for over an hour and still cant figure wtf is wrong with the code.. can someone help me....

/ Check if the user is ready to play!
confirm("are you ready to play?");
if (true)
prompt("how old are you?");
var age = prompt("how old are you?");

if (age <= 13)
{
console.log("im sorry, you are to young to play");
}
else
{
console.log("Lets Begin!");
}

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?");


#2

var x = confirm("are you ready to play?"); //First, you need to make a variable to hold the answer to your question
if (x){ //Or, you could put it in the parenthesis
    var age = prompt("how old are you?");
    if (age <= 13) {
        console.log("im sorry, you are to young to play");
    } //If they are under thirteen, then you want to exit, correct?
    else
    { //Otherwise run this code.
        console.log("Lets Begin!");
        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?");
    }
}