I don't get it what am i doing wrong:( (4)


#1

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

// says: "you did not declare foodDemand"


#2

from exercise 3: You can run this code by "calling" the function, like this:

sayHello("Emily");

now, if i look at your function call:

foodDemand = ("pizza")

it seems you try to assign something to foodDemand, and you forgot at a semi-colon at the end of the line.


#3

i putted the semicolons but still say "you did not declare foodDemand"


#4

semi-colons? semi-colon you mean, did you also do the other thing? can i see an updated version of your code?


#5

Didn't close your curly bracket & forgot to print* "pizza" . Example .

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


#6

I think it shood look like this
var foodDeman = function(food) {
console.log("I went to eat" +" "+ food);
}
foodDemand("pizza");


#7

@ivanshere, you do realize that your code is wrong?

@masterchin, yes your could works, but i was on purpose not providing a full answer, especially not without without any explanation. I wanted to help them, but let them do most of the thinking, teaches them more then a answer


#8

you do not need an = sign when you are calling and it might make it easier if you change the console.log from food to pizza and make your called function food


#9

you really need a 11 month old topic for this? Please don't


#10