Exercise 2, checking the user's age


I'm getting the error message, Oops, try again. It looks like you didn't check for the user's age.
My code did however, so I'm confused as to what's the matter.
There's nothing else wrong, the console runs properly and takes my code.

confirm("Are you ready to play?");
var age=prompt("What's your age");
if (age < 18) {
    console.log("You're allowed to play, but I shall take no responsibility!")
else {
    console.log("Good luck playing!")


you should check if the user is 13 or older, not if they're 18 or older :slight_smile:


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