"Did you add an 'if' statement to your code?"


#1

(Continuing from https://discuss.codecademy.com/t/did-you-add-an-if-statement-to-your-code/74002)

I have the same problem;

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 pace, so i can race without pacing.'");
}

and says try again. Did you add an if statement to your code?
HELP Please!


Did you add an if statement to your code?
#2

i Keep getting the same thing... i think the lesson is broken


#3

You can add "if", "else if", and "else"

if (condition1) { 
  code to be executed if this condition1 is true;
}
elseif (condition2) {
    code to be executed if this condition2 is true;
 }
else { 
  code to be executed if all conditions are false;
}

#4

ya i had to reload browser for it to work. thank you


#5

Had the same problem. Thanks, this works.


#6

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