Confirm age


confirm(" I AM READY TO PLAY!");
var age = prompt("what is your age");
confirm("This is my age");
if(age < 18)
console.log("Play at your own risk");
console.log("Have fun gaming");

this is my code. all the prompts come up including the one asking your age, but it says an error that i didnt check the users age. pls help


You did it incorrectly, but just with this:

Instead of 18, try replacing it with 13, as said in the directions. If it still doesn't work, refresh.


Also make sure your strings are displaying what's supposed to be displayed exactly, if they are telling you specifically what to say.



confirm (" Are you ready to play ? ");
var age = prompt("What is your age?");
if (age < 13)
console.log("You can play this game but we are not responsible");
console.log("We encourage you to play this game");


My code was correct, but IE did not like it.
My fault for using IE.
I tried it in Chrome, and it worked straight away


confirm("Let's Go!");
var age=prompt("How old are you?");
if (age under 13);
console.log("You can play, but we take no responsibility");
console.log("Great, play on!");

I keep getting SyntaxError: missing ) after condition, but there is a ) after the condition. I don't understand!


How can you express this condition using a comparison operator?


It doesn't ask for one, and that's not what it says the problem is.


If you look up what a comparison operator is and does in javascript, it would help you understand what you're having difficulty with.


Wat dit I wrong in this code can some wan tell me ?
var age = propmt;
if(age < 13)
console.log("you are allowed to play but you take no responsib");
console.log("you are ready to enter the game !");


Thanks guys, this helped :smile: I think most people just choose the wrong age. It has to be 13.