Varify users age


When I run the code it tells me that I didn't verify the users age. But I still get the pop up box to enter my age.

// Check if the user is ready to play!
confirm("Ready To Play")
var age = prompt("What's your age");
if (age < 18)
console.log("Ask your parents permission to play!")
console.log("Get ready for an Adeventure!")

Replace this line with your code.


No error message just.. Oops, try again. It looks like you didn't check for the user's age.


Anytime you post a topic regarding a lesson, please include the link to that lesson. If I remember correctly, the instructions want you to compare age to a specific number. I don't think the number is 18.


Thank you! I thought I could enter my own input.


Glad you worked it out :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.