+ 1
What is the difference between argument and parameter in javascript or any other language?
Some example would help better in understanding.
3 Respuestas
+ 11
“Parameter is the variable in the declaration of a function. Argument is the actual value of that variable that gets passed to that function when it is called/invoked.”
function myFunc (parameter) {
return parameter + 4;
}
myFunc (argument);
I hope you understand it now ;)
+ 1
thanks Dev .
0
Simple:
PARAMETER → PLACEHOLDER (This means a placeholder belongs to the function naming and be used in the function body)
ARGUMENT → ACTUAL VALUE (This means an actual value which is passed by the function calling)
This is also good to remember.