If else statement


I don't understand what i am doing wrong
There was a problem with your syntax.

    userAnswer = prompt("You and Bieber start racing. It's neck and neck! You win by a shoelace!")
    userAnswer = prompt("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'")
condition: you should evaluate is your "age" more than, 13


The else statement doesn't need a condition. It's saying that anything else that is not specified by the if statements will run here. Does that make sense?


I have tried that but it doesn't do anything


Is this your full code because you didn't make a variable called condition before you made this if/else statement.


okay i will try that and see if this works


Also remove this part:

I think this is just telling you what to do.


okay I just tried that and it still says syntax error


Can you post a link to the exact lesson your on?




Can you show your full code or is this it?


//Here's your answer
confirm("START");// Check if the user is ready to play!
var age = + prompt("What's your age");
if (age >= 13) {
console.log("You are allowed to play, but we take no responsibility for that");
else {
console.log("You are too young to play this game! Go to school");


age>=13 is actually your condition in if/else statement


okay thank you very much


prompt is a pop up that asks a user for any input (string or number)


this isn't for the correct one this question is for the story heats up


you assign your user answer (in prompt) to your var, that is called age, and then you evaluate it


You're not supposed to post the full answer. On the Q&A forums we are here to help each other solve our problems and learn from our mistakes. We are not here to give short cuts and "cheat" if that's what you want to call it.


I've just followed your link


Sorry, I'm new here, I've only asked questions, I'll try better in explaining things


it is the second if/else statement.