Parameters
A parameter is a variable in a method definition. To say it another way, a parameter is the variable in the declaration of the function, and it is found inside of the parenthesis.
File Location
We will be working in the following file:
Sample Code
In the function below, we see two parameters: name
& type
.
Arguments
We'll talk in the next module about arguments, but the following function calls show how the parameters work like variables. We put a different value in each time we call it:
Key Points
We'll get a lot more practice with parameters in the future. The key takeaways are these points:
Parameters are like variables.
Declared in the parenthesis of a function.
The arguments are the values that get assigned to the parameters when the function is called.
Last updated