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

What is an argument?

Asked by 10 years ago

What does an argument look like? hear the word argument here and there, but I don't know what it looks like. Thanks!

2 answers

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

An argument is a value (or variable that holds a value) that is passed to a function when it is called. The values the arguments hold are "passed by value" into the function's parameters.

function name(param1, param2 --[and so on]]) --function declaration, with parameters
    print(param1)
    print(param2)
end

local a = "Hello"
name(a, "World!") --function call, with arguments.

A function may not require all parameters be matched with arguments, and you can also give more arguments than there are parameters without errors.

An example of the first type of function is the FindFirstChild method. Most people only use its first parameter, the Name of the child instance being looking for. If the second parameter, a boolean, is passed a true, FindFirstChild will also search the descendants of the instance it is called on.

Ad
Log in to vote
-1
Answered by 10 years ago

A given value inside of a function's parenthesis during a call.

Answer this question