Some explanation about And


i did not call the function by writing eat() at last line, but it works , how ? can anybody explain me plz .
// 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



the exercise likely calls the function to validate your code is correct, what is it you don't understand?


to call the funcntion , i had to write 'eat()' at end line of the code , i did not do that , but the code worked . how ?


yes, a function only executes when called.

codecademy needs to verify your code, in order to do so, the function is called behind the scenes


i want to say that i did not write 'eat()' to execute the function , but it executed , how ? would u tell in other way.


because the exercise calls the function behind the scenes? given the exercise has to validate if your function works correctly executing the function is required, so the exercise does that for you behind the scenes


codeacademy just verify my code , and it call the function from behind the scenes. but in practical project i must hve to write eat() at finishing line , am i right ?


if you want the function to execute, yes.


thank u so much...........................................