Why is this happening?


#1

Why is this showing this? I am trying to make it respond to the exact words "Yes, I did"


https://www.codecademy.com/courses/getting-started-v2/4/5?curriculum_id=506324b3a7dffd00020bf661

SyntaxError: Unexpected token (

// Not sure where to begin? Check the Hint! 
var myQuestion = prompt.("Did you finish your first game?");

if (myQuestion === "Yes, I did");
{ 
    console.log("I finished my first course!"); 
    } 
else 
{ 
    console.log("I did not finish my first course".); 
};

#2

You have a few syntax errors there. JavaScript can't figure out what you want to do.

  • You've put an unwanted . between prompt and its (.
  • You've put a end of command indicator, a ;, at the end of the above line. That is ending your if statement right there, that means that all of the rest of that statement is being included.
  • Above, you have another unexpected/unwanted .

#3

Thank You!! That worked!


#4

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