11. And



Getting the "There was a problem with your syntax." error message.

var hungry = true
var foodHere = true

var eat = function()
    if (hungry && foodHere);
    { return true }
    { return false}
eat ();


As you are using a semi-colon-;
at the end of your IF condition

(hungry && foodHere);

and the semi-colon-; is an End-of-Statement indicator to the Javascipt Interpreter
the rest of your IF statement is NOT seen as being part of this IF.........

Remove the semi-colon-;


Thanks for the help, I didn't relize that.


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