Javascript design your own game #2


#1

Can't figure out what I'm doing wrong here/ what is really being asked:

// Check if the user is ready to play!

confirm("I am ready to play!");
var age = prompt("What's your age");
MyAge= "27";

if (age is less than 13)
{
console.log (You're allowed to play but I take no responsibility);
}
else
{
console.log (Play on!);
}


#2

is less is not valid, you should use signs <
Try with if(age < 13)
Also you need "" in console.log so write
console.log ("You're allowed to play but I take no responsibility");


#3

MyAge= "27"; is not needed in your code because when you ask user :

var age = prompt("What's your age");
you save his answer in variable called age that you use later in code like you see. variable MyAge has value of a string, yes string because everything between "" "" is a string and you are not using it at all so you can delete it.

P.S. If you wanna save a number in a variable, just write var name = 27;