1

I know the difference between arguments and parameters, but I'am a bit confused about how jQuery uses these terms.

For instance, jQuery defines as "parameters" the options passed to the load method. These shouldn't be declared as arguments because you pass your own values?

Then, on ajax function you can find many times the terms "parameters" and "arguments". For example, if you search for the beforeSend property, you'll see:

The jqXHR and settings objects are passed as arguments.

But, in another section you'll also see:

The callback hooks provided by $.ajax() are as follows:

beforeSend callback option is invoked; it receives the jqXHR object and the settings object as parameters.

Does it mean that jQuery uses equally the terms "parameters" and "arguments"?

4
  • 2
    Why are we answering a question that has been asked and answered before on StackOverflow AND is a simple Google search?
    – Rick S
    Oct 28, 2015 at 18:09
  • Of course, I have seen all the answers but why jQuery uses both terms for the beforeSend callback. See my example. These should be arguments, right?
    – fmuser
    Oct 28, 2015 at 18:17
  • 1
    The first case says that the jQuery code that internally invokes beforeSend passes in those arguments. The second case says that the beforeSend function should be parameterized (i.e., have parameters) to receive the jqXHR object and settings object. The difference may seem very small, but that's because the difference between arguments and parameters is quite small. I admit it's possible that the human who wrote this particular piece of jQuery documentation could have been slightly clearer about the minutia of arguments vs. parameters, for whatever benefit that would bring.
    – apsillers
    Oct 28, 2015 at 19:30
  • @apsillers Thanks for taking the time to explain it!
    – fmuser
    Oct 28, 2015 at 19:49

2 Answers 2

1

"A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters."

What's the difference between an argument and a parameter?

-1

"parameters" are passed , "arguments" are received


See

What does passing a parameter mean? in C#

Parameters and arguments

What is an 'Argument' in Programming means?

1
  • 2
    Even though it's semantics, I think this is technically incorrect. Although, I can't imagine a situation in which someone would be confused by using them interchangeably.
    – Stan Shaw
    Oct 28, 2015 at 18:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.