4/13 Santax error


#1

This is my code:

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

Can anyone tell me why it wont work?


#2

This is what it should be below. remember to always bring in the {} in declaring functions

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

Check it out here


#3

Ooooh, thanks. That makes more sense.


#5

i need help with this too.

i'm writing:

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

and the console answer is TypeError: console.log is not a function....
help?


#6

Press F5 or whatever refreshes your page and try again.