11.And——why the code is not right?



Oops, try again. It looks like your function doesn't return true when hungry and foodHere are both true.

var hungry = true;
var foodHere = true;

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



The function eat should take no input and hungry and foodHere should both be globals.

so you don't need any parameter for the function


Got it. Thanks for you help!


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