Glitch? Bad Code?


#1


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


I'm getting the "Oops, try again. It looks like you didn't print the less than or equal to 8 message" message, and yet the code behaves appropriately. Why is it asking me to use a "<=" sign, anyway? I tried using that symbol, even though it didn't make sense, and it still didn't let me pass. I even tried ">=" and still nothing. Here's my code:


confirm("Let's go!");
var age = prompt("What's your age?");
if(age < 12)
{
    console.log("You may suffer psychological harm from this game. Js.");
}
else
{
    console.log("You are old enough to play, fool!");
}
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.'");
}
var feedback = prompt("What would you rate this game on a scale of one to ten?");
if(feedback > 8) {
  console.log("Thank you! We should race at the next concert!");
}
else {
console.log("I'll keep practicing code and racing.");
}

I've carefully gone back and checked each line, but I still don't see any errors? Can anyone tell me if this is just a glitch (so I can move on to the next lesson), or bad coding on my part? Thanks.


#2

Your message is different from the one described in the instructions. Therefore, you did not print the message that was asked for.

Those exercises aren't locked, you can freely navigate between them without completing previous ones.


#3

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