Oops, try again. There was a problem with your syntax


#1

https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/6?curriculum_id=506324b3a7dffd00020bf661#
Oops, try again. There was a problem with your syntax.

confirm ("Are you prepared to start your journey?");
var age = prompt("What's your age");
if (age < 13) 
{
    console.log("you are too young to play");
} 
else 
{
    console.log("you may continue your journey");
}
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 ("how would you rate this game from 1 - 10?");
if (feedback > 8) 
{
    console.log ("Thank you! We should race at the next concert!"); 
}
else 
{
    console.log ("I'll keep practicing coding and racing.");

Can't get this working, please help!


#2

1- Delete the Semicolon at this line:

2- You didn't put a curly bracket after else here:

3- put one equal sign instead of three at this line:

4- Close the curly bracket here:


#4

That question may be odd, but do you use the developpers tool of your web browser?

The best way to debug your app would be to open it (Ctrl+Shift+J for Chrome/Chromium, Ctrl+Shift+K for Firefox (if i'm not wrong))

You will find a console tab, wich will throw you all the errors, not only the console.log() results, helping you to debug your app...

If there is too much things in the console, add console.clear() at the top of your script, it will clear the console before executing your lines of code, helping you in the process of finding what's wrong.


#5

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