Help with 3.4? Invalid syntax for function?


#1

Hey guys,

I'm trying to do the basic function excercise, however it keeps telling me that my Syntax is incorrect. I've run this through another syntax parser called esprima, and it tells me the syntax is fine.

Can anyone tell me what I've done wrong?

Thanks!

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

foodDemand("banana");


#2

After reloading the page, I'm not getting a new error with the same code.
"Oops, try again. It looks like you didn't put quotes around the food you gave foodDemand!"


#3

Hi the error is how you wrote function


#4

wow. I've been beating on that for 30 minutes.


#5

Put quotes around "food"


#6

No food is the name of the parameter which gets it's value by the function call foodDemand("banana"); so food really needs to be a variable name (without quotes). With quotes you'd use the word "food" which is not what you want. Is that clear?