5. The Story heats up! problem with syntax


#1


  1. The story heats up!


var age = prompt("What's your age");
if(age > 13)    
{
console.log("If you are little dont play");
}
else 
{console.log("Play the damn game");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.logconsole.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 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.'");


#2

Hi you didn't closed you else statement and here

console.logconsole.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");

you got two console.log


#3

Oh how did I not notice that even after I fixed it though I still have an error


#4

can you post your new code and the error you get now?


#5

Yeah
var age = prompt("What's your age");
if(age > 13)
{
console.log("If you are little dont play");
}
else
{console.log("Play the damn game");
}
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 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 am getting SyntaxError: Unexpected end of input


#6

but here

else{
  console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");

}   <== //add  one } to close the else statement