programmingtechnology

Understanding Arguments and Parameters

To understand Arguments and Parameters, it is important to have a knowledge of JavaScript. JavaScript is a functional language. It implies that function is a core part of writing and executing JavaScript codes.
 
For many, there seems to be a bit of confusion about the two concepts of argument and parameter in JavaScript.
 
Hence, this article plainly explains Arguments and Parameters.
 

What is Parameter?

A parameter is variables listed as part of the function definition. So, these are usually located within the first bracket when defining a function.
 
Example:

 

Explanation:

Here, the Parameters are the variable a and b.

What is Argument?

Arguments are values that move to the function when invoked or called.

Example:

Explanation

Here, the values 2 and 3 go to the function. And it executes.

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

Leave a reply

Your email address will not be published. Required fields are marked *

Next Article:

0 %