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 10 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
10 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 — 10y
Ad
Log in to vote
1
Answered by 10 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 — 10y
0
Accidently had caps :P iluvmaths1123 198 — 10y

Answer this question