I am stuck on exercise 2: Old enough to play?


#1

I am stuck on exercise 2: Old enough to play?

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

My code:
// Check if the user is ready to play!
confirm("I am ready to play")
var age = prompt("What is your age?");
if (age > 5)
{ 
console.log("You are ready to play!")
}
else
{ 
 console.log("Sorry, This game is only for people over 5")
}

#2

Oh wait i solved it now, missed that it had to say 13 not 5


#3

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