when you make a function you usually just “define” it, instead of writing its body. An example function could be the print function. Like this

c# code

```
int Add( int num1, int num2 );
```

This is just the prototype. The type of the function is “int” which means essentially it has to return data of type int (integer). If you were to put float, that would mean the function would have to return data of type float (where it be a variable containing something 0.0f, or 0.0f.) Add is the name of the function, and the two variable inside of the ‘(’ and ‘)’ are the parameters (also know as arguments). The parameters are variables you can pass to function to use.

This is how you would go about writing the definition of the function

```
int Add( int num1, int num2 )
{
int sum = num1 + num2;
return sum;
}
```

This should be pretty self explanatory. It’s just the prototype with the body or definition of the function. What we do is create another variable of int called sum, and set it equal to num1 + num2, and then return the data (you’ll see what I mean by returning it in a second). See how we use the parameters?

This is how we could use that function in context.

```
...
int one = 1;
int two = 2;
int OnePlusTwo = Add( one, two );
print( OnePlusTwo ); // This function is made up, pretend it prints it's parameter ( OnePlusTwo ) to the screen.
```

we make two variables and store 1 and 2 in them. Then, since the function Add is of type int and thus must return something of type int, we can set a variable of type int equal to what the function Add returns. In this case, since we pass in one and two as the parameters/arguments, Add will return the sum of those to variables, in this case is one + two, or 1 + 2, or 3. So, we set OnePlusTwo equal to what Add( one, two ) returns, which is 3.

Hopefully you understand this. This uses C#, so data types are important. If you were to use JS, then the data type doesn’t matter as much. Though you can explicitaly declare what type function and variables are like this

```
var myVar : int;
// or for function
function Add( var num1 : int, var num2 : int ) : int
{
//....
}
```

The reason I used C# is so you understood how function return data, and why/how parameters can be useful in this.

If there is anymore confusion, please ask

edit - Beat to it …