Need Help with 4/13 JS


#1

Its saying syntax error.
wHERE IS THE ERROR. plz help


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


#2

here:

var foodDemand=function("food")

your parameter can't be a string, it should be a variable


#3

this doesnt work.


#4

Do you mean you used just that line that @stetim94 provided? You need to use the rest (in the {} ) too.


#5

the code i provide is just to show what line the learner goes wrong, then i explain why he goes wrong, you still have to apply the fix (helping and providing the solution are two different things)

So yes, if you copy paste, that indeed won't work.

If you need help, please go here and make a new topic (fill in the template so we have the information needed to help you)


#6

when it is not a string, it asks to make var foodDemand a string?


#7

or rather, it says its not in quotes


#8

please follow the above advice.


#9

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