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:

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.

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The pros and cons of Big Design Up Front — and what I do instead

Release is imminent

MapReduce With MongoDB Aggregation Framework

How to Create an Eas

Containerized Development Environment for Flask + Angular + MySQL

My 2016 Fall Semester

Let me share a live example.

Fundamentals of AWS Networking

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
Andrew Ly

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

More from Medium

Scope There It Is

My function’s ‘Thumb Rule’

OOP 101 (Object-Oriented Programming)

Pair Programming