Syntax error


#1

The syntax error in my code keeps appearing and I'm not sure missing.

Instructions:

Under the existing code, declare a variable age.
Make age equal to prompt("What's your age");. See the example above.
Then write an if/else statement. If age is less than 13, use console.log to tell the user that they're allowed to play but you take no responsibility.
Else, use console.log and give them an encouraging message to play on!

My code:

confirm("Are you ready to play?")
var age = prompt("What's your age");
if (age>13); {
console.log("You are allowed to play but I take no responsibility.")

}

else {
console.log("Play on!")
}


#2

Try taking the semicolon away.


#3

Four things!

  1. You'll need to end your confirm with a semi-colon similar to your prompt on line 2.
  2. Your if statement should have a condition of age is less than 13.
  3. Remove the semi-colon immediately after your if statement condition. We don't want our if statement to end yet!
  4. End all of your console.log()'s with semi-colons. These are one off commands.

    confirm("Are you ready to play?");
    var age = prompt("What's your age");
    if (age<13) {
    console.log("You are allowed to play but I take no responsibility.");

    }

    else {
    console.log("Play on!");
    }