Difference between parameters and arguments - are they the same?
Many programmers use the terms 'parameters' and 'arguments' interchangeably. Consider the following function -
If you want more clarification or have doubts, post them below so that we can discuss.
function best_function_ever( int $param1, string $param2, bool $default = true )In the above code, $param1, $param2 and $default are 'parameters'; or are they arguments? Most of the people would say there's no difference between them and they are correct. However, at times, you might be required to know the subtle difference between the terms parameters and arguments. So keep this in mind:
- Parameters: These are the values that your function will accept, as designed.
- Arguments: These are the actual values that you pass when calling the function.
If you want more clarification or have doubts, post them below so that we can discuss.
0