The function in JavaScript does not restrict parameters and checks:
function does not mind how many parameters are passed in, or what type of arguments are passed in (even if the number of arguments is inconsistent with the definition of function).
The parameters in the function are internally saved by the arguments, which is an "array" (in fact, just like an array), which can be obtained by means of subscript access to the parameters of the passed function.
Arguments.lenght can get the number of arguments to the function passed in.
function Test () { // 0// 1// 2
Named parameters in a function definition are only convenient, but are not required.
The named parameters remain in sync with the elements in the corresponding arguments:
function Test (ARG) { arguments[0] + = ten; Alert (ARG);} Test (//
If a parameter is defined in function, but no value is passed to the parameter, the parameter is automatically assigned the undefined value.
[JavaScript] named parameters and arguments