Say, you want to pass some information to a Function.
For example, if you want a Function to add two numbers. You need to pass those two numbers to the Function.
Say, in the below example, you want the add Function to add two numbers for you. And you have passed those numbers in between the brackets () of the add Function(i.e. firstNumber and secondNumber).
And those elements inside the brackets () of the add Function is called as Parameters and the actual value passed to them is called as Argument.
<html> <body> <script> function add(firstNumber, secondNumber) { let result = firstNumber + secondNumber return result } var firstNum = 5 var secondNum = 4 var value = add(firstNum, secondNum) document.write("The added result is ",value) </script> </body> </html>
So, the variables inside the add Function is called as Parameter.
And the actual values (i.e. 5 and 4) to be sent to the Function are the Arguments.
Throughout the tutorial we will be calling the Parameters as Arguments to avoid unnecessary confusion.
Now, what if, you have defined a Function with two Argument but made the Function call with one argument.