\i wrote the right syntax and still having error message!


#1

i cant pass this stage ! can anyone help me please


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


#2

Your code looks fine. Can you please copy and paste your error message?


#3

I'm stuck on the same problem, I believe my code is right too but I'm getting an error.

confirm("I am ready to play!");
var age = prompt("How old are you?");
if (age<18)
{
console.log("I take no responsibility");
}else{
console.log("Play on!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Beiber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Beiber on stage?");


#4

the message is are you sure you have used if statment?


#5

Having the same problem: CODE
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") {
// Do something
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
} else { // Otherwise...
// Do something else!
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

ERROR MESSAGE:Oops, try again. Did you add an if statement to your code?


#6

if (age<18)

age is 13.


#7

Not entirely sure if you left it out on purpose, but I believe your code needs to start by asking if the user is over 13. Like what @greentreemee said. Your finished code should look like this.

confirm("I am ready to play!")

var age = prompt("What's your age") 
if(age < 13){
    console.log("You are allowed to play but you take no responsibility") }
    else {
        console.log("Play On!") }
        
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.'")}

If you are still getting a error message, it could be due to your browser. Try using something other than chrome such a Firefox.

If neither of those suggestions worked please let us know.


#8

Good eye! I changed the code to say 13 but still get the error. Hmmm.


#9

If you are still getting a error message, it could be due to your browser. Try using something other than chrome such a Firefox or IE.


#10

This worked! Seems fine in Firefox.


#11

Could you please mark my reply as the solution so when others get this problem they will know what to do.

There seems to be a trend of this happening.


#12

I am not OP, I don't believe I have that ability, I appear to have hijacked his thread.

OP: Did you ever get your problem solved?


#13

Oh yeah haha sorry about that. I'm nearly 100% positive that if the other people in this thread do what you did. The problem will be solved.


#14

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