Trying to make a game


#1

var name = prompt("Hello, what is your name?");
var age = prompt("How old are you?");
if (age < 10) {
console.log("Hmmmmmm this must be " + name + ", well you can play but be careful because it might be scarry");
};
else {
console.log("Hello, " + name );
};

It keeps saying there is a syntax error I've pinpointed it to be in the else statement but just cant find it. I could use some help with it please and thank you.


#2

You have ; after your if block. Remove it and it should be ok. Removed it after else block too.
So have

if ( // condition ) {
  // code
} else {
  // code
}

No ; after }.