4. How does a function work


#1


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

I keep getting "Oops, try again. You did not declare foodDemand!" not sure what wrong here.


#2

In calling your function you shouldn't need an equal sign just the function and the parameters so get rid of it!


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.