11. And. I get false"


#1

I get "FALSE", but I don't know why, please help.

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

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


#2

I was wrong at this line:

var eat = function(hungry, foodHere) {

That's the way it works.

var eat = function() {


#3

Hey, may I know why you used return and not console.log? because i got a problem because i wrote a console.log instead return..
also if i write console.log(return);
do you think it's possible beause it didnt worked for me as well ^
thanks!


#4

I think
console.log(return);
is wrong, if you want to print what function returns, you have to write function with 'return', and then call it like this
console.log(eat(true, true));


#5

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