What does mean : SyntaxError: unexpected identifier


#1

Well, I'm an engaged question about that:

SyntaxError: Unexpected identifier was printed out after my following response to the "Old Enough to Play" case:

confirm("Are you ready?")// Check if the user is ready to play!
var age = prompt("What's your age");
if(age is less than 18) {
console.log("you're allowed to play but you are only one responsible");
}
else {
console.log("CONGRATS! YOU'VE JUST GROWN UP!");
}


#2

confirm("Are you ready?")

You just forgot the semicolon at the end of this statement, no biggie.

EDIT: Yeah, what @mtf said as well.

But don't forget the semicolons!


#3

It means there is a word that looks like a variable where something else is expected such as a token.

The interpreter is expecting a comparison operator and is instead seeing 'is less than'.

    if (age < 13)

is what is expected.