I can't understand what is wrong


#1



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

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


#2

HI you shouldn't remove the if statement that check for the age


#3

I don't declare "age". How do I fix my source code?


#4

You could Copy all your code then click on RESET CODE then past the code you copied under the one who show up


#5

I understand. I deleted previous my source code.
Thank you very much!! I solved this probrem.


#6

A few things that I noticed a few problems with your code. One, with your if statement then you forgot curly brackets, same with you else statement. Also, on your last two console.log statements then you forgot semicolons. All in all, your code should look like this.

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

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

#7

HI the brackets can be omit you can learn more about it here..


#8

I didn't know that thx a lot :slight_smile: He is still missing the semicolons on the console.log statements though.