Part 5 (Code your own adventure -- the story heats up!)


#1

Hello! I keep getting the same issue for Part 5 (Code your own adventure -- the story heats up!).

Link:
https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661

Error showing: "Oops, try again. Did you remember to put in the 'no' answer option?"
`
CODE I have......what am I doing wrong?:

confirm("I am ready to play")
var age = prompt("what's your age")
if(age < 13)
{
console.log("you can play but 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 packing.'")
}


#2

I tested your code and It works fine(FireFox).


#3

Okay, thank you! Weird. I'll try switching browsers then


#4

Just to be clear it didn't show any errors for you? I tried on firefox and it still shows the error. The code works like it should (I get the correct response when I say yes or no), but the error shows after, preventing me from moving on to the next part.


#5

Hi @ah930
I have noticed a weird thing...

1.When I commented out my code and just tested your code,It let me pass.

2.When I deleted my code and tested your code , It thrown me an error and error is just a misspelling,You can see even It was misspelled in 1 (when I commented out my code),It have not thrown any error.

so solution is here..
You need fix final else clause string...

else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without packing.'")
}

You can see it is pacing not packing.


#6

Ahhh got it. It works now. Thank you!!


#7

Its not working for mehh :-:


#8

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