SyntaxError: Unexpected identifier


I've been trying to do an if/else statement, but I don't know what's going wrong. I'm coding after a month so my memory isn't that fresh as yet, and there might be some mistakes. It would be great if someone can help me out.

confirm("I am ready to play")
var age = prompt("What's your age")
if(age is less than 13)
    console.log("You are allowed to play but we don't take any responsibility")
    console.log("Let's go!")


in JavaScript, we use >, <, =, != as comparison operators, you're also missing a few semi-colons.


I actually have the same problem. Even if I used and fixed the " less then " statment with a > icon, it still says that there is something wrong.
here is what I got...
confirm("Ready to Play?");
var age = prompt("What's your age?");
if(age < 16 )

{ console.log(" You may play, but I hold no Responsability "); }


{ console.log(" You may play, ENJOY! ");}

( I would appreciate the help )


Thanks sir, it actually worked.


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