Code your own adventure syntax error


#1



I cant figure out whats wrong with this i did everything the way it said to and i kept getting the same syntax error please help.

https://www.codecademy.com/en/courses/javascript-beginner-en-x9DnD/0/7?curriculum_id=506324b3a7dffd00020bf661


SyntaxError: Unexpected identifier


Replace this line with your code. 
confirm ("Are you ready to play?");
var age = prompt("What's your age?");
if (age is less than 13) {
    console.log ("Sorry not old enough");    
} else { (age is more than 13)
    console.log ("Lets go!");
}
console.log ("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing'");
console.log ("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Bieber on stage?")
if (userAnswer = prompt("yes") {
"You and Bieber start racing. It's neck and neck! You win by a shoelace!"
} else { userAnswer = prompt("no")
"Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'
}
var feedback = prompt("What did you think of the game? 1-10");
if ( var feedback = prompt("greater than 8")) {
  "Thank you! We should race at the next concert!"
 } else { (var feedback = prompt("less than 7"))
 "I'll keep practicing coding and racing."
}


#2

There are some points I can help you with:

  1. Always replace the is less than with < and replace is more than with > .

  2. After there are no conditions bound to the else part of the statement only the if one does (Later on you will learn a new statement. For now delete the (age is more than 13) part in your else statement.

  3. if you declare a variable with a prompt, the variable will have the value your input. So
    var userAnswer = prompt("Do you want to race Bieber on stage?") will change into var userAnswer = "yes" even if you didnt put that in the code. You can delete all the (var feedback = prompt("greater than 8")) kind off parts and change them into a (feedback > 8) kind off part. Try looking at your code for this kind off things because this mistake is being made alot.

  4. Also you started your code doing this good but ended up skipping it. If you want to print something for the people that are playing your game to see use the console.log() command. You started doing this wrong in your 2nd if/else statement.

After doing this your code will work. I fixed your code but will not publish it until after you tried the 4 steps above and still it still doesnt work.

Good luck.

Greetings,

Amin

PS: Sorry for my bad english if you find some grammarly incorrect sentences. I'm not from an english native country.