Home | Javascript validator | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.
Microsoft® JScript®
arguments Property
 Language Reference 
Version 2 

See Also                  Applies To


Description
Returns 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);
}

Home | Javascript validator | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.