Ask coding questions

← Back to all posts
Weird syntax error
20rduncan (13)

I keep getting this syntax error on my program and I don't know what it means:
SyntaxError: Unexpected token, expected ; (5:17)
Can anyone help me out?

Answered by pyelias (1420) [earned 5 cycles]
View Answer
pyelias (1420)

else shouldn't be followed by a condition (like (age < 21)). Just use else { ... }

20rduncan (13)

Oh! Okay, I'll fix that. Thanks for the help!