Old enough to play?


#1

It keeps saying something is wrong with my stynax but I can't figure out what. Can someone else help me this is my code:
confirm("I am ready to play")
var age = prompt("What's your age");
if(age is less than 13)
{
console.log("You may play but I have no responsibility over you and your actions.")
}
else
{
console.log("Go right on ahead and play! :D")
}


#2
confirm("I am ready to play");
var age = prompt("What's your age");
if(age is less than 13){ 
   console.log("You may play but I have no responsibility over you and your actions.");
} else {
   console.log("Go right on ahead and play! :D");
};

Console.log must have a semicolon after it. Also, it would be nicer if you put the { } in the same line as the if/else.

Hope it helps :smiley:


#3
  1. you should write "is less than" become "<"
  2. don't forget to give semicolon
    confirm("I am ready to play");
    
    var age = prompt("What's your age");
    
    if(age < 13) {
    console.log("You may play but I have no responsibility over you and your actions.");
    }
    
    else {
    console.log("Go right on ahead and play! :D");
    }