+ 1

What is the difference between argument and parameter in javascript or any other language?

Some example would help better in understanding.

26th Aug 2018, 4:09 PM
bit_byte
bit_byte - avatar
3 odpowiedzi
+ 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 ;)
26th Aug 2018, 4:18 PM
Dev
Dev - avatar
+ 1
thanks Dev .
26th Aug 2018, 4:24 PM
bit_byte
bit_byte - avatar
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.
26th Aug 2018, 5:14 PM
bit_byte
bit_byte - avatar