Lesson 4. How does a function work. What am I doing wrong


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

What am I doing wrong? It keeps saying: "You have not called foodDemand!"
Please help.

Replace this line with your code.


You need to include a function call in your code.


I am completly lost, Please help with line by line assistance.

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

I cannot figure this out???

SyntaxError: Unexpected string literal "food". Expected a parameter pattern or a ')' in parameter list.


String rather than argument.

Function call inside function.

Also forgot ending curly brace.


I am also having trouble with this and none of these answers make anything clearer for me. Please elaborate.


Hey guys, check your syntax i.e spacing, values, etc. Your code should look like this:

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

Happy coding!