How does a function work? 4/13


#1

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

foodDemand("Pizza");

// what's wrong with this code?


#2

You put:

var foodDemand = function("food"){

In a function, you are not supposed to put a string inside the function. Instead, you have to do it like this:

var foodDemand = function(food){

Hope it helped!:smiley:


#3

your variable function parameter should not have quotations. Seems like you got the rest of it.
see example below:

var firstName = function(name) {
console.log("My first name is" + " " + name);
};

firstName("crjr30");