Intro to JS - "Function Syntax" "did not declare Food Demand?"


#1

// Write your foodDemand function below.
// Last hint: In your reusable block of code, end each line
// with a semicolon (:wink:
var foodDemand = function(food)
{
console.log("I want to eat" + " " + "food");
};
Demand=("Pizza");


#2

Hey @askqna,

The correct way in calling a function is with this structure:

function(replacement for parameter)

Which would be:

foodDemand(pizza)

Not:

Also, remember that food is a parameter, not a string. :smiley:

That equals to no quotation marks around the parameter food. :smiley:


#3

@askqna in your console.log code, do not put " " around food. Also, when you call the function on the last line, it should be:

foodDemand("pizza");

because this is the name of the function which you gave it on the first line.


#5