Stuck on 5


#1

confirm("are you ready to play?");
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 my a shoelace!");
}
else{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing");
}

can someone help me? It keeps saying that I didn't add an if/else statement


#2

@codejumper79050 try changing the "=" to a "==="


#3

add a ; to the end of console.logs


#4

It's happening the same to me, and my code is the following. What i'm doing wrong? Thanks!!

confirm("are you ready to play?");
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.'");

}


#5

Hi what error do you get ?


#6

It says that i'm not doing an if/else statement. I tried with the google chrome console and it works fine...the codeacademy console is showing the result correctly, but the application doesn't allow me to continue telling me that im not doing the if/else statement. It's because i'm working with firefox?

Thanks!!


#7

Do you still have the if and else statement that check for the age?


#8

Yeah, sure! :

// Check if the user is ready to play!
var age = prompt("What's your age?");

if (age < 13 ){

console.log ("You're allowed to play but i don't take" +
"responsibility");

} else {

console.log ("Okay, go on!!!");

}


#9

I have the same problem...

`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.'");
}`


#10

HI can you post all your code and the error you get?


#11

Hi I ran you code and it work fine


#12

Oooops, okay, now it's working correctly.

The problem was that i was not including the "age" part of the exercise...

Thanks a lot!!