Problem with code


#1

I'm in the chapter "Introduction to Functions in JS", and I don't get what I do wrong.

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

The error I get:
Oops, try again. It looks like you didn't put quotes around the food you gave foodDemand!


#2

Your function name is foodDemand not just food.

So to call your function just add Demand to the food like,

foodDemand("Spaghetti")


#3

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