J. Biber if/else


#1

Hi, I have problem with code if/else. I think that my code is good, but I have error. My code:
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.'");
}
Where is error?
Did you add an if statement to your code? i don't know where I make error.


#2

What exercise are you on?


#3

Exercise 5,
The story heats up!


#4

Have you tried submitting your code with another browser? For example, I've had problems in Safari while doing AngularJS course, but when I switched to GChrome all the problems with platform just vanished.


#5

I use browser FF and os linux fedora 25.


#6

:thumbsup:

Code looks fine. Try another GChrome :wink:


#7

At the same chrome :frowning:


#8

Uhm. Try resetting the exercise, then.


#9

I make logoff and refresh browser and logon and at the same.


#10

// Check if the user is ready to play!
confirm("i understand confirm!");
var age = prompt("What's your age?");
if(age < 13){
console.log("You are allowed to play but I assume no responsibility")
}
else {
console.log("Go ahead and 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.'");
}
SOLVED finally


#11

Thank you for your help, it worked


#12

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