Cant get the code to work


#1

this my code why wont it work
var age = prompt("what's your age");
if(age is less than 13)
{
console.log("you shall not pass");
}
else(age is over 13)
{
console.log("the way is open to you");
};.

`


#2

Hi this line

if(age is less than 13)

you put < instead of is less than


#3

it still says there is an unexpected identifier


#4

And this line

else(age is over 13)

remove (age is over 13)


#5

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