4.how does functions work- syntax error? Confused ;S


#1


I dont understand why it is giving syntax error. I also dont understand why i leave " " empty in console.log . I did like in the previous instruction

https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/0/4?curriculum_id=506324b3a7dffd00020bf661


SyntaxError: Unexpected token


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


#2

var fooddemand = function(); // unnecessary semi-colon

and your function has no parameter, but you do supply an argument when calling the function


#3

very helpful! thank you @stetim94


#5