And bug


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/2/2?curriculum_id=506324b3a7dffd00020bf661


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


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

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


What does it mean when it says parameters?
#3

I fixed it now. I needed to remove the parameters hungry and foodHere, but I don't understand why.


#4

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