Else as unexpected token


#1

Keep getting else as an unexpected token, what am I doing wrong here?

// 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); }
};


#2

@dvdvoorn you are not ending declaration with the semicolon(:wink:

you used
-var hungry= true
var foodHere= true

use-

var hungry= true;
var foodHere= true;


#3

Al right, so I've done that now, but I still get the same response..

// 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); }
};


#4

You need to get rid of the semicolons after the conditions, here is an explanantion why: