Code your own game pls help exersise 2


#1


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")  }


#2

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.


#3

now another problem!


#4

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

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

#5

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


#6

"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){

}

#7

now another problem and also sorry for disturbing u a lot


#8

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") }

#9

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


#10

pls reply fast 12121212121212


#11

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