Quick Code Tip: Arguments versus Parameters

Andrew Ly
1 min readJul 21, 2020

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:

function foo(param1, param2) { // do something } foo(10, 20);

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.

--

--

Andrew Ly

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