Old enough to play


struggling on old enough to play on javascript


Please paste your code into your post and what you need help with on what exercise so we can help you.


// Check if the user is ready to play!
confirm("Are you ready to play");
var age = prompt("whats your age");

if (age>=13)
console.log("you can play but ask your parents first");
else (age<=13)
console.log("Good luck have fun.");


First, change your "if" statement. You should be checking if the person's age is less than 13, not greater than and equal to:

Next, for "else" statements, there isn't a argument, for else statements. There shouldn't be any parentheses for the else statement: