Why do we have to write 'return' not 'console.log'?


So this code is displaying an error(I know why). The purpose of this question is as to why we cannot use console.log in this situation? Why do we have to use return?

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

var eat = function() {
  if(hungry && foodHere){
  else {


Because the exercise wants you to use return, if this where you own code, you where free to choose between console.log and return


Oh, OK, thanks a lot!:wink: