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


#1

This is what I have so far, and while the prompt shows up and asks my age, and the translator is showing my message, I cannot move on as the bottom of my screen displays " Oops, try again. It looks like you didn't check for the user's age." even though I clearly am.

// Check if the user is ready to play!

confirm("I am ready to play!");

var age=prompt("What's your age?");

if(age < 16)
{
console.log("You are too young to play this game.")
}
else
{
console.log("Time to play baby!")
}


#2

Nevermind I figured it out, didn't realize I needed to make the age 13, I thought I could use whatever age I wanted.


#3

This is the right code , hope this will help you
confirm("I am ready to play!");
var age = 12;
var age = prompt("what's your age");
if(age < 13){
console.log( "you're allowed at your own risk!");
}
else{
console.log( "hurray go ahead!");
}


#4

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