Most programmers use these terms without distinction of meaning. In practice, saying the wrong term or certain will not make the code work or not, it will depend on you, but it is always good to know and understand the differences.
Imagine a parameter such as a variable that can be received by a function or a method . For a better understanding, see this example in JavaScript:
function somar(param1, param2) {
return param1 + param2;
};
This function will always receive two parameters (param1 and param2). In addition your exit will always depend on the entrance. So with this little explanation we can already conclude that the parameter will always be bound to its input.
The rules for how parameters are passed to functions are determined by the programming language, for example, these rules can specify the order of parameters, whether they are passed from left to right, or vice versa. In addition rules can define whether parameters will be passed by reference or value .
Note: Parameters can be of any type, an array, an integer, a String, or other data type (of course this varies in programming languages).
On the other hand we have the argument, which would be the value passed (may be more than one) function at the time of your call. See:
let valor1 = 10;
let valor2 = 20;
let valorSoma = somar(valor1, valor2);
During the above code execution, the variables "value1" and "value2" are initialized and passed as arguments for the somar()
function. Within it, the parameters are evaluated and the arguments '10' and '20' are obtained. These values are summed, the result is returned and assigned to the variable "valueSum". It is important to note that variables are not parameters or arguments.
I believe that only with the above explanation can you understand the logic and difference parameters and arguments, but we will see in simpler ways what each one can mean.
I've heard definitions (and they're true) that an argument could be the parameter instance, not literally, but it's an interesting analogy.
Another way to identify (not to forget) the difference of each:
References: