Can't Find the Quotation Problem


#1

If anyone could help me find whats wrong with my set up here on the last few lines that would be great!
confirm("Are you ready to play?")
var age = prompt("What's your age");
if(age < 13)
{
console.log("You may play but I am not responsible for anything that happens from now on.");
}
else(age >= 13)
{
console.log("Play on have fun and don't die!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shows off, start racing.'");


#2

Spot anything there? You gave a condition to your else statement which is dangerous code. To fix this then re-write your else statement as an else if statement and then add your else statement right before your last console.log. All in all your code should look like this:

confirm("Are you ready to play?")
var age = prompt("What's your age");

if(age < 13)
{
console.log("You may play but I am not responsible for anything that happens from now on.");
}
else if(age >= 13)
{
console.log("Play on have fun and don't die!");
} else {
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shows off, start racing.'");

}


#3

Thank you very much! Fortunately I found it on my own!


#4

It's always good to be able to find little bugs and problems on your own :slight_smile: good luck in future lessons.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.