Lesson 11 won't work for me


#1


Oops, try again. It looks like your function doesn't return false when hungry is false.
Here's: my code:
var hungry = true;
var foodHere = true;

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

};

Replace this line with your code.


#2

You just need to add another else if statement to detect if hungry is false.


#3

I did though.

else if (hungry && foodHere === false){
return false;


#4

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