There was a problem with your syntax. Can't figure out what the issue is


#1



Stuck at Program your own adventure chapter 5


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

SyntaxError: Unexpected end of input

Can't for the life of me figure out where the error is.


// 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("You're allowed to play, but we take no responsibility"); 
} else {
    console.log("Have fun!");
}

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==="yes") {
        console.log("You and Beiber start racing. It's neck and neck! You win by a shoelace!");
} else {
        console.log("Oh no! Beiber shakes his head and sings 'I set a pace, so I can race without pacing.'");


#2

Hi, tienes que poner una sentencia ELSE IF en lugar de ELSE.:relaxed:


#3

Eh, no. En este ejercicio no deberias poner ningun tipo de else / if

to @blogplayer91199, my code is:

// Check if the user is ready to play!
confirm("I am ready to play!");
// Check if the user has the right age
var age = prompt("What's your age");
if ( age < 13 ) {
    console.log("You are allowed to play, but we take no resposibility on any circumstance");
}

else {
    console.log("Alright. You can play!");
}

// Story
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?'");

// Check if user wants to race Bieber
var userAnswer = prompt("Do you 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.'");
}

#4

Pero se dice en las instrucciones de "utilizar una sentencia if / else para escribir la Ășltima parte de este juego!"