January 2003
Beginner to intermediate
1200 pages
23h 42m
English
The values you pass to functions are called arguments. When you pass data in arguments to a function, the code in the function has access to those values. When you create a function, you specify which arguments are to be passed to the function in an argument list.
Here's an example. In this case, I'll create a function named adder that will add two values and return their sum. Here's how I start creating adder:
function adder()
{
.
.
.
}
This time, we're going to pass arguments to the function. So, we list the arguments that we'll pass by giving them names in the argument list, which is enclosed in the parentheses following the function name. Here, I'll call the two arguments passed to addervalue1 and value2:
function ...