Microsoft® JScript™
arguments Property
 Language Reference 
Version 2 

See Also                  Applies To


Description
An array containing each argument passed to the currently executing function.
Syntax
function.arguments[ ]

The function argument is the name of the currently executing function.

Remarks
The arguments property allows a graceful way for functions to handle a variable number of arguments. The length property of the array contains the number of arguments passed to the function.

The following example illustrates the use of the arguments property:

function ArgTest()
{
   var i, s, numargs = ArgTest.arguments.length;
   s = numargs;  
   if (numargs < 2)
     s += " argument was passed to ArgTest. It was ";
   else
     s += " arguments were passed to ArgTest. They were " ;
   
   for (i = 0; i < numargs; i++)
     {
       s += ArgTest.arguments[i] + " ";
     }
   return(s);
}