3/7 bieber


#1

Could someone please tell me what im doing wrong with this code?

// Check if the user is ready to play!
confirm("I am now ready to play the game!")

var age = prompt("What's your age");

if(age < 13);
{
console.log("you are not old enough to play");
}
else
{
console.log("Enjoy the game!");
}

console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");


#2

An if-statement consists of a header which says if and then a condition.
That is followed by a single statement that is executed only if the condition is true, followed by an optional else-statement.

A statement can be multiple statements. We accomplish this by putting {} around statements, and the whole thing is now a single statement.

You have an empty statement following your if-header due to your semicolon.


#3

Thank you so much for the prompt reply, your explanation was fantastic.