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


// 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");


Hey @askqna,

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

function(replacement for parameter)

Which would be:



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

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


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


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