Code your own game pls help exersise 2


it shows like this  SyntaxError: syntaxError    I tried a lot but no

this is my code 

// conform ("are you ready?"); 
  var age=prompt ("whats ur age");  if  ("age===13") confirm ("time to get started") }   else  {  console.log ("sorry u cant play")  }


The undetermined string is because you have a ' that shouldn't belong. You will also get another error once you fix that because conform() is not correct. You spelled confirm() incorrectly.


now another problem!


Please tell us what the problem is. You are missing a { from your if statement.

if(this is true){
     do this
     do this instead


pls check properly I told you the problem (first sentences)


"age===13" should not be in quotes. You have a string as the condition. You want to check to see if the variable is equal to 13 so use no quotes:

if(age === 13){



now another problem and also sorry for disturbing u a lot


Check the way your () and {} are in your if statement. You have a { before the statement when it should be after the ().

if ( age === 13 ){ confirm("time to get started") }


ok fixed it but now !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


pls reply fast 12121212121212


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