Varify users age


#1

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!")
}
else
{
console.log("Get ready for an Adeventure!")
}


Replace this line with your code.


#2

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


#3

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.


#4

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


#5

Glad you worked it out :slight_smile:


#6

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