11/14 (and?)

Oops, try again. It looks like your function doesn’t return false when hungry is false.

// Declare your variables here!
var hungry = true;
var foodHere = true;

var eat = function() {
// Add your if/else statement here!
var hungry = true;
var foodHere = true;

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

// Declare your variables here!
var hungry = true
var foodHere = true
var eat = function() {
// Add your if/else statement here!
if (hungry && foodHere) {
return true;
}
else {
return false;
}
};

2 Likes