Share via


arguments Property (JScript 5.6) 

Returns the arguments object for the currently executing Function object.


function.arguments

Remarks

The function argument is the name of the currently executing function, and can be omitted.

The arguments property allows a function to handle a variable number of arguments. The length property of the arguments object contains the number of arguments passed to the function. The individual arguments contained in the arguments object can be accessed in the same way array elements are accessed.

Example

The following example illustrates the use of the arguments property:

function ArgTest(){

   var i, s, numargs = 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 += arguments[i] + " ";

      }

   return(s);

}

Requirements

Version 2

Applies To: Function Object (JScript 5.6)

See Also

Reference

arguments Object (JScript 5.6)
function Statement (JScript 5.6)