What Are Parameters Used For In Functions?
✓ ANSWER ACCEPTED
What Are Parameters Used For In Functions?
2 answers
✓ Accepted answer
They are used to reference argument(s) someone might use when they call the function. For example:
function add(x, y)
print(x + y);
end
add(5, 6);
--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.
2 comments
0
NOT THAT PARAMETER AND NOT THAT FUNCTION
0
Accidently had caps :P
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks!