Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What Are Parameters Used For In Functions?

Asked by 9 years ago

What Are Parameters Used For In Functions?

2 answers

Log in to vote
3
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
9 years ago

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
0
Thanks! iluvmaths1123 198 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

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.

0
NOT THAT PARAMETER AND NOT THAT FUNCTION iluvmaths1123 198 — 9y
0
Accidently had caps :P iluvmaths1123 198 — 9y

Answer this question