11. And


#1



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


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 }
    else
    { return false}
}
eat ();


#2

@scottm14172,
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-;


#3

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


#4

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