Ok a few things are wrong with this one.
First this thread was dead for about 2 Month.
Second it already has answers.
Third your code has flaws that are already mentioned in these answers.
Fourth what is the difference between your two snippets?
Ok I've found it that you moved the function call from the inside to the outside of the function and that is correct. But please if you post solutions give some more details so that your answer can be helpful to others.
And about those flaws:
No "" around the parameter name food. It should be a variable.
No function in the name of the function functionfoodDemand -> foodDemand
(not quite necessary in JS but demanded by the instructions.)
Matching function names functionfoodDemand != foodDemand
Ok I guess that's all. Hope this helps you to improve further answer. Thank you!