Why is this happening?


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


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!"); 
    console.log("I did not finish my first course".); 


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 .


Thank You!! That worked!


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