2. Old Enough to play problem


#1

It keeps saying you didn't check for the users age, and in the log it says my else statement.

confirm("Are You ready to Play?")
var age = prompt ("what is your age");
if("age" >= 16)
{
console.log("you are allowed to play");
}
else
{
console.log("you are not allowed to play");
}


#2

Since age is a variable there is no need for quotes :slightly_smiling: .

just

if(age >= 16)

will do

You were literally comparing the string "age" to 16 which will probably not give you what you want.

Hope that helps :sunny:


#3

thanks for the help :).