JavaScript JavaScript Basics Creating Reusable Code with Functions Review: Giving Information to Functions

Difference between 'parameter' and an 'argument'?

Been wondering what the difference between a 'parameter and a 'argument' is. Thank you.

2 Answers

Antti Lylander
Antti Lylander
9,660 Points

from 15 sec google search:

"A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters. Parameter is variable in the declaration of function. Argument is the actual value of this variable that gets passed to function."

Jahanzeb Khan
Jahanzeb Khan
226 Points

both are the same thing.

Thank you for the reply Jahan, I've just learned that they are in fact not the same thing. It is called a parameter at the construct level of the function, and its called an 'argument' at the calling and execution level of a function. Either way, thanks a lot!

Antti Lylander
Antti Lylander
9,660 Points

Almost, but not quite.

"A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters. Parameter is variable in the declaration of function. Argument is the actual value of this variable that gets passed to function."