2/4.how does a function work?


I have a problem with this section. I couldn't find out where am i wrong?

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


Get rid of the ; after }


no work, still show " There was a problem with your syntax." ooops


You're already passing a value "hamburger" to the function but not making use of it by again using "hamburger" when printing the console message. I havent used JS for years but this is redundant code. Have a look at what I've just mentioned.


What comes in the () of function should be a variable name. The way it gets its value is by the function call sofor it to work it should rather by something like:

var foodDemand = function(food){...};


here the value "hamburger" is assigned to the variable food so now you need to use food in your output message to display "hamburger". Is this clear?