2. old enough to play


#1

// Check if the user is ready to play!
confirm("Are You ready to Play?");
var age = prompt ("what is your age");
if(age >= 7)
{
console.log("you are allowed to play");
}
else
{
console.log("you are not allowed to play");
}
I don't know why it doesn't work but i want the solution
Oops, try again. It looks like you didn't check for the user's age.


#3

@cameleonulverde,

The Instructions.....
02. Make age equal to prompt("What's your age");. See the example above.
03. 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.


#4

I have the same problem on the course. it says Missing ) after argument list
here is my code
confirm("Are you ready to play my text based adventure game?");
var age = prompt("What's your age?");
if(age<13);
{
console.log(WE TAKE NO RESPONSIBLIY ABOUT YOU PLAYING THIS GAME);
}
else
{
console.log(This is my first game, so enjoy);
}


#5

Try by using a string Value

"WE TAKE NO RESPONSIBLIY ABOUT YOU PLAYING THIS GAME"

in your console.log() statement.


#6

It didn't work :frowning:


#7

and I get the same error message


#8

@astronautraccon

if(age<13)
{
 console.log('WE TAKE NO RESPONSIBLIY ABOUT YOU PLAYING THIS GAME');
 }
else 
{
 console.log('This is my first game, so enjoy');
}

#9

thanks! and a little bit of the side, where is the heart button?