2. Code Your Own Adventure


#1

What's wrong with this code I keep on getting 'SyntaxError: Unexpected token else
// Check if the user is ready to play!
confirm("Are you readdddddddyyyyyyy!!!!");
var age = prompt("What's your age?");
if (age<13)
{
console.log("You are allowed to play, however, I take no responsibility.");
else
{
console.log("Welcome to the game");
}


#2

Try taking away the " ; ", mine works without it.


#3

var age = prompt("What's your age?");
if (age<13)
{
console.log ("You are allowed to play, however, I take no responsibility.");
}
else
{
console.log ("Welcome to the game");
}


#4

Your missing a bracket in the if statement...
}


#5

Y'all are being too subtle.. This is how you're suppose to do it.

var age = prompt("What's your age?");
if (age<13)
{
console.log ("You are allowed to play, however, I take no responsibility.");

} <----------RIGHT HEEEEEEERE


else
{
console.log ("Welcome to the game");
}

#6

haha I'm taking this approach from now on :laughing: