What does an argument look like? hear the word argument here and there, but I don't know what it looks like. Thanks!
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.
A given value inside of a function's parenthesis during a call.