Quick Code Tip: Arguments versus Parameters

What’s the difference between Arguments and Parameters?

Arguments and parameters are often referred to interchangeably, but they are in fact, different. Not by much but in order to speak the language among coders, and for the purpose of this quick tip tutorial, we will make the distinction.

Parameters (or formal parameters) are the variables given inside the function declaration


Arguments (or actual parameters) are the values passed to the function.

The distinction is subtle, but parameters are what is initially put into the function definition, whereas the arguments are what you pass in after. Let’s take it one step further with an example function:

In this function example, param1 and param2 are function parameters, and the values passed to the function ( 10 and 20) are arguments.

And that’s it! Hope it helps!

Originally published at https://www.andrewjly.com on July 21, 2020.