What's the problem?


#1

The system is saying I'm not using an if statement, when I obviously am. What am I missing please?

// Check if the user is 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?'");

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

Add a semi colon ; at the end of both console.log statements.


#3

doesnt work do any developer of developer check a error in my code


#4

Please post your code


#5

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


#6

Try without the semi colons at the end. Like this

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

#7

Not helping :frowning: in my case test .can anyone fix it


#8

Even the code above? :hushed:


#9

yes even the code above


#10

Then it must be a problem with yOur browser because I tested that piece of code and it worked. Unless,
The error is in the rest of your code.


#11

post all of your code from line 1 to the end.


#12

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


#13

That can't be all the code you have since you started the unit. :smile:


#14

thanks ,i deleted the previous lesson code :stuck_out_tongue:


#15

Yup that's the problem. :laughing:


#16