Its saying SyntaxError: Unexpected token


#1

var foodDemand = function(food);
console.log("I want to eat" + " " + food);
foodDemand("Jilebi");


#2

@stirumal16 hello, you forgot to use the curly brackets around console.log. try this:

var foodDemand = function(food); {
console.log("I want to eat" + " " + food);
};
foodDemand("Jilebi");


#3

also get rid of the ; before the { otherwise it wont work.


#4

var foodDemand = function(food); {
console.log("I want to eat" + " " + food);
};
foodDemand("Jilebi");

but still it is not working.it says SyntaxError: Unexpected token


#5

@benjnev oops you are right :smile:


#6

@stirumal16 like @benjnev said, take out the ; before the {, so like this:

var foodDemand = function(food) {
console.log("I want to eat" + " " + food);
};
foodDemand("Jilebi");