Lesson 11 won't work for me


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.


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


I did though.

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


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