11. And


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

Someone help me I'm stuck here's my code
I don't know what wrong it says:

Oops, try again. Did you declare a variable called foodHere?


inside the function it should be foodhere not foodHere

and here

if (hungry && foodHere === true && true) //wrong

you could simply check

if (hungry && foodhere)


if (hungry===true && foodhere===true)


Thanks. I solved it.


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