What Are Parameters Used For In Functions?
They are used to reference argument(s) someone might use when they call the function. For example:
1 | function add(x, y) |
2 | print (x + y); |
3 | end |
4 | add( 5 , 6 ); |
5 | --11 |
A parameter is an interchangable piece of data that a function processes.
For example, in math.abs(n), n is the only parameter. The actual data put in place of the parameter is called an argument. So if I were to call math.abs(-2), -2 would be the argument I'm using to fill out the parameter.