Lesson 2) Old Enough To Play? Syntax Error


#1


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


I keep getting SyntaxError:Invalid or Unexpected Token for my code. I don't exactly understand what is wrong?


// Check if the user is ready to play!
confirm("I am ready to play!")'

var age = prompt("What's your age");

if(age < 13){
console.log("sorry too young to play")
}

else
{
   console.log("You can play!")
}


#2

Your code is mostly fine, you just have text issues or something.
Delete the ' after "I am ready to play! And you should be good. :stuck_out_tongue:


#3

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