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


#1


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


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


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


#2

where is your age prompt?


#3

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

if(userAnswer==="yes"){
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? "


#4

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


#5

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