2.Old enough to play


#1

here's my code
confirm("Ready to play...");
var age = prompt("What's your age");
if(age < 7)
{
console.log ("You are not allowed")
}
else {if (age > 7)
console.log ("Start")
}
it says 'Oops, try again. It looks like you didn't check for the user's age.'


#2

On the else if statement you started the bracket on the wrong place... Its suppose to be in this syntax:

else if(conditon){

}

And it would help if you could take a look at this..


#3

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


#4

confirm("Ready to play...");
var age = prompt("What's your age");
if(age < 7)
{
console.log ("You are not allowed")
}
else if(age > 7){
console.log ("Start")
}


#5

Im preety sure there is no else if statement... Its just suppose to be an else statement


#6

it doesn't work
aaaaaaaaaa


#7

Should be

else {
    console.log("Start");
}

#8

confirm("Play?");
var age = prompt("Whats your age?")
if(age is less than 13)
{
console.log("You can play but i will take no responsibility")
}
else
{
console.log("Start")
}
It says "there was a problem with your syntax"


#9

Hi don't post on ald post 3 MONTH LATER it's better if you create a new post next time.

then

here

if(age is less than 13)

you should remove is less than and put <