Justin Bieber sez "SyntaxError: Unexpected token }"


#1

I can't see what my error is here. I read through all the FAQ Q&A, and still don't see my error. All was well before adding the if/else part. SO if someone could point out my stupid mistke that my eyes cannot fine, I will appreciate it. Thanks, JJ.

PS: I hope I got the format right for this question area.

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

"SyntaxError: Unexpected token } "

// 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 play. but we take no responsibility.")} else {console.log("Get 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.'")};

#2

Right between your last else { and final console.log statement, there's a stray ( parentheses.


#3

Oh my goodness, thank you very much; that added paren lied to my eyes for three hours!

JJ


#4

It blends in nicely :slight_smile:


#5

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