Please Help: Syntax Error Unexpected token else


Here is the link to the exercise iam stuck at:

I am getting a message "Syntax erroe unexpected token else.I don't know what Iam doing wrong.

Here is my code:// Check if the user is ready to play!
confirm("I am ready to play");
var age = prompt("What's your age");
 console.log("You are allowed to play but, I take no responsibility");
 console.log("Please play on,enjoy");


this line:


that is one very dangerous semi-colon, preventing your if statement from running properly. Remove the semi-colon


Thanks you so much Stetim94.I removed the semi-colon and my code ran perfectly.Just to be clear,i don't need to put a semi-colon in my if statement,i.e the condition?


Absolutely not, as you just discovered the program doesn't run properly when putting a semi-colon on your if condition, you must not put semi-colons at your if condition (very important)


Thanks very much.I have learnt a valuable lesson.I will never forget that.