Stuck's in 4. How does a function work?, help


#1

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


#2

The period between your function and parameter here is wrong syntactically.


#3

Thank's, i don't understand, what dou you mean?


#4

Punctuation marks mean different things in javascript. You have to watch how you use them or your code won't work how you wish.

Right after foodDemand, you have a period. That little character disrupts your function.


#5

like this?

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

thanks for your patience, i'm new in this.


#6

You removed the period which was the main error but you also removed your "pizza". That was fine. Put it back.


#7

jajajajajaja, i'm sorry, the problem was, a "p" stay before to comments, i don't saw at 2 seconds, thank's for help me, man

p// 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);
};
console.log(foodDemand("pizza"));


#8

No problem, we're all here to help each other out

What happened when you submitted your code?


#9

appear have wrong with your syntaxis, and imprime just "p".


#10

Where did this "p" come from?

You mean this?

Usted uso la palabra imprime, me imagino que hablas español. Estudie un poco, de todos modos, ojala que le ayude la siguiente discusion:


#11

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