Lesson 2 - Code Your Adventure - help!


#1


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


"There is a problem with your syntax"


// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age?");
if(age<13){
    console.log("Play on, but we can't be responsible");
} else {
    console.log("Play on!");


#2

You're missing the closing } bracket at the end. It should be

confirm("I am ready to play!");
var age = prompt("What's your age?");
if(age<13){
console.log("Play on, but we can't be responsible");
} else {
console.log("Play on!")
}


#3

I tried it it doest work


#4

[i can't detect the problem, they only said 'Oops, try again. Did you add an if statement to your code?']

var age = prompt("What's your age");
//if
if (age <13) {
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.'");
}

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


#5

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