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.’”);
}
can someone please help me and tell me if i did something wrong
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'");
}
See the indentation? It might be different for this isn’t Python, but try taking out the indentation in the brackets. Or copy paste the one above.
// 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?’”);
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’”);
}
I’m still in this problem too
My code
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.’”)
}
First, I suggest putting semi colons after the console.logs. After that, assuming that it still doesn’t work, did you try copy and pasting the statement to it? If it’s not exact it will not function.
Can i ask what is wrong with my code as well? I have tried all of the suggestions above and the program still doesn’t let me proceed to the next step. @ragezapper
There doesn’t seem to be a problem with the last if loop… maybe you can refresh, but as you have said, since you have already done that, can you show me the whole code in your editor?