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


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


SyntaxError: Unexpected token

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


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

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


very helpful! thank you @stetim94