Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is an argument?

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

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.