Function Problem


#1

So I'm on the second lesson #4, and I don't fully understand how a function works, here's my code and I'm not sure what I'm telling the computer to do and/or why it doesn't work:

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


#2

You're so close!!

Remember that when you're calling a function that holds a parameter:

var foodDemand = function(food) {
                            ^

That you have to add a value to that parameter.

console.log(foodDemand ( /*Add something here!*/ ) );

#3

Ohhhh, thanks for the help!


#4

I don't understand why undefined appears at the bottom of this code...
var foodDemand = function(food)
{
console.log("I want to eat"+" " + food);
}
console.log(foodDemand ("Randomness"))


#5

Why calling that function is not working like this?
foodDemand(pizza);


#6

you forgot to put double quotes like


#7

"I want to eat" + " " + food

Is there some other way to create free space character before food?


#8

You did almost right, you dont need to look for another way,
So you just missed SPACE between double qoute:
"I want to eat" + " here is just space" + food
If i got your question right
Also u can skip typing of additional doublequotes like this:
"I want to eat here is just space" + food