JS Old enough to play?

// Check if the user is ready to play!
confirm(“I understand confirm!”);
confirm(“I am ready to play!”);
var age = prompt(“What’s your age?”);
if(age < 13)
console.log(“You can play,but I take no responsibility!”);
else {
console.log(“Go ahead! You’ll play very good!”);

Hi Julia,

the "if: part should look something like this:


i guess one of the rules is that in writing conditional statements, put the number or the script before the variable

Hey @julia_programmer! Your actually right i will provide a screenshot below showing that. And @megaplayer05756 that is not the problem just because you put a parantheses in a variable getting in a conditon dosent affect a problem most of the time…

So the screen shot(i dont understand your problem is it not working for you?):


I’m glad that it worked for you instantly, but I had the same problem as hers, and what I pasted above worked for me.

I’m not saying that your solution is wrong, because it’s not, but the site can act faulty depending on your browser.

but hey @amanuel2, you learn something new every day right?

1 Like

I am getting this message “oops, try again. It looks like you didn’t check for the user’s age” when think I did check for age… what am I missing? going nuts

confirm(“Are you ready to play?”);
var age = prompt(“What’s your age”);

if (age<= 18)
console.log(“I am not old enough to play”);
console.log(“You can play all day”);


(and if I am posting incorrectly, please let me know… I am totally new to this)

Yeah, what browser do you use. And can you printscreen in here.

Hey @iriekat! Two things, first when you paste your code, it is going to be formatted when you select over your code and hit CTRL + K. Secondly your problem is that you just need another confirm like for example saying:I understand confirm! So put this in the top of your code and it should work!!

confirm("I understand confirm!");

thanks for the quick response @amanuel2

-Google Chrome as Browser

… hmmm… you mean like this

I still get the error message saying I did not check for users age

oops - this is the correct print screen

This is a major bug, i better make an announcment

Did you try if(age<13)? Sometimes the exercises ask specific things and we must do as asked :slight_smile:

Please don’t encourage the use of images over code, it’s annoying when you can’t copy and paste the code in to check it, but instead have to type the whole thing…

-It’s also against community guidelines.

@jibblyj thank you for the correction. Noted for the future. I’m really really new to all of this.

1 Like

guwo… DUH… you are the man/woman!?
it worked with 13… ughhhhhh thank you …

Im just trying to see if it is actually legit. And how is it against the community guildlines.

You’re supposed to try and help debug other people’s code instead of just giving them your code.

inferior beings accept defeat

What’s that supposed to mean, exactly?

this is my code and it works very well
// Check if the user is ready to play!

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 (“Have fun playing! good luck bro!”);

1 Like