FrontendDeveloper.in

JavaScript question detail

What is the difference between a parameter and an argument

Parameter is the variable name of a function definition whereas an argument represents the value given to a function when it is invoked. Let's explain this with a simple function

function myFunction(parameter1, parameter2, parameter3) {
console.log(arguments[0]); // "argument1"
console.log(arguments[1]); // "argument2"
console.log(arguments[2]); // "argument3"
}
myFunction("argument1", "argument2", "argument3");
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399