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

VERSUS

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.

Founder of Neo Typewriter. He is a published author, podcast host, digital marketer, and full-stack web developer. Read more at: www.andrewjly.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store