I Don't Understand This!


#1

How does a function work?

There's a problem with my syntax/


Replace this line with your code. 
foodDemmand = function("food") {
    console.log("I want to eat" + " " + food);
};


#2

Functions are like memory blocks used to save a mini program inside them. A function has an input we call parameters, the body of the function does the magic stuff, and then it outputs a result.
Functions comes with no quotes so remove the quotes from "food" like so:

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

#3

Why is this wrong?
var foodDemmand = function (food) {
console.log("I want to eat" + " " + food);
};

foodDemmand("pizza");


#4

If you take a look at:

and

you wrote Demand with 2 M's


#5

Oh. My bad. Ha ha::blush:


#6

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