THE STORY HEATS UP in Javascript - Where is error?


#1

Help please! I can not get the IF / ELSE statements to work. Below you will only see IF statements, but I have tried ELSE as well. I keep getting the OOPS you forget the 'no' answer, which I haven't.

Any ideas?? Thank you!


// Check if the user is ready to play!
{
confirm("I understand!");
}
{
var age = prompt("What's your age");
}
if(age < 13) 
{
    console.log("You will be allowed to play, however we take no responsiblity.");
}
else
{
    console.log("Enjoy playing, have Fun and WIN WIN WIN!");
}
{
console.log("You are at a Justin Bieber concert, and you hear this lyric: 'lace my shoes up, start racing'. Suddenly, Bieber stops singing and asks '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!");
}
if (userAnswer === 'no')
{
  console.log("Suddenly, Bieber stops and says, Who wants to race me?");
}

#2

Remove the brackets around this console.log,

And around this,


#3

Hi Bandit,
Removing those brackets didn't change the OOPS did you forget the 'no' answer ERROR!
However I did forget to mention in my post that the code I wrote IS working properly if the "yes" or "no" is entered
into the pop-up box. The correct answers to come up! It's just that the OOPS ERROR does not let me go forward
in the Codecademy program?? Is this a Codecademy issue perhaps??


#4

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