The story heats up syntax error


#1

Can anyone tell me what's wrong with my code? Thanks!
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")
{
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.'");
}

It keeps showing me to add an if statement whiich I've already done.


#2

I pasted your code you have given in my lesson and it passes for 5.) The story heats up. Is that the lesson you are on in code your own adventure?


#3

Is the rest of the code still there? You should have the age checking if statement.


#4

I believe he just posted what he added in that particular lesson but then again I could be wrong. That is why I asked what lesson he or she was on.


#5

yeah, the same lesson. Bu, it doesnt gets passed for me . pls help!


#6

why should we have that age statement?
It's again a new statement. Anyways, thanks for replying.


#7

We are trying to figure out what lesson you are on. Is that all of the code in your window? Did you just paste what you added this lesson? We need more information to help with an interpreter error.


#8

well, i'm on the story heats up lesson. The whole code is what I've pasted before.


#9

For whatever reason, your code is missing from a previous lesson.

// Check if the user is ready to play!

confirm("Are you ready to play!");

var age = prompt("What's your age");

if(age < 13){
    console.log("You can't play, you underaged ***!")
}
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?'")

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

Thanks a lot!! @tekkie1618


#11

i don't get it I've done all of that it just won't work.


#12

thanks so much! all of you it really helps


#13

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