11. And


#1

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

Hi,

It says that this code is right, but why it does not print anything to the black box? Like true or 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

function don't get executed, unless you call them:

eat()

now if you want to print what the function returns, wrap the function call in a console.log:

console.log(eat())