I'll try to explain functions.

```
var getCost = function(number_of_items) {
var item_price = 2.50;
var cost = item_price * number_of_items;
return cost;
};
```

With the above, we wrote a function called "getCost". This function, "getCost", has 1 parameter "number_of_items".

If I have 3 items, I need to pass in a value of 3 to getCost.

e.g.,

```
var cost_of_3_oranges = getCost(3);
var cost_of_5_oranges = getCost(5);
```

What happens in real time:

```
Create variable cost_of_3_oranges.
Look at variable "getCost", realize it is a function with 1 parameter "number_of_items".
[ // bracket scope = getCost function
number_of_items = 3
create item_price variable with value of 2.5
create cost variable with value of item_price multiplied by number_of_items.
- number_of_items = 3, i know this from the passed in value of 3
- item_price = 2.5, i know this since i declared it to be 2.5 within the function
- cost = 2.5 * 3 => 7.5
return cost out of function.
]
set variable cost_of_3_oranges to be equal to the result from the function getCost with parameter "number_of_items" value of 3.
cost_of_3_oranges is now equal to 7.5
```

I hope this has helped clear the air around functions.