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?
What is the difference between arguments and parameters?
-
- Newbie
- Posts: 1
- Joined: Wed May 07, 2025 4:47 am
Re: What is the difference between arguments and parameters?
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.
x and y are parameters, 3 and 7 are arguments.
Code: Select all
async function add( x, y ) {
return x + y
}
add( 3, 7 )