Page 1 of 1

What is the difference between arguments and parameters?

Posted: Sun May 11, 2025 6:36 pm
by JefferyAExley
I think I understand, but I would like to explain a little more.

From what I gather, these two terms are often used interchangeably, but technically they have distinct roles depending on the context.

Parameters are variables listed in the function definition — they act as placeholders.

Arguments, on the other hand, are the actual values ​​that you pass into the function when you call it. These values ​​are assigned to parameters.

Is that explanation correct?

Re: What is the difference between arguments and parameters?

Posted: Mon May 12, 2025 1:23 pm
by bens
That is correct. Different programming and scripting languages sometimes interpret or define these terms differently, but your explanation is the most commonly used one - when the difference matters.

Code: Select all

async function add( x, y ) {
return x + y
}

add( 3, 7 )
x and y are parameters, 3 and 7 are arguments.