# The Difference Between a Parameter and an Argument

Is there a difference between a parameter and an argument? Are they synonymous with one another?

I've been guilty of it myself when talking about functions……using the words parameter and argument interchangeably.

I mean, they both come after the function name in the parentheses right?

Right!

Then what's the difference between a parameter and an argument?

### Our Example

Let me explain in this very simple function:

``````function squared(number) {
return number * number;
}``````

### Parameter Explained

The parameter of this function is number.

This is the variable name used to reference the arguments passed to the function.

It can be named anything, but you should choose something relevant.

### Argument Explained

The argument of this function will be what you actually pass to it.

When we call this function we will pass a real number as an argument like this:

``squared(4);``

The argument is 4 and the function will return 16.

If we passed 5 as the argument, the function will return 16.

### Conclusion

As you see, this is a subtle but important difference in terms.

Our function has number as the parameter used to reference the argument we will pass to the function (4 or 5 as our examples above).

Hope this helps next time we use the two terms.

Have you mixed these two up before? I think we all have!!

----------

Travis of

#### Travis Media

Who Am I? I was 34 years old in a job I hated when I decided to learn to code. Read More
Recent Posts
Nov 18, 2023
Nov 17, 2023
Oct 27, 2023
Explore

### Become a Web Developer From Scratch in 2023

The Exact Blueprint… The Exact Course… And How To Land …