I can not figure out why I am getting a syntax error on code your own adventure 1.2



Oops, try again. There was a problem with your syntax.

if (age < 13) {
console.log ("You can play, but I take no responsibility");
console.log ("Cool, play on!");


where is your age prompt?


var userAnswer=prompt("Do yo want to race Bieber on stage?");

console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
} else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");

i get this error, don't know why ?
"Oops, try again. Did you add an if statement to your code? "


you have to create a variable of "age" like
var age=prompt("what is your age?");


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.