Share via


0...n Properties (JScript 5.6) 

Returns the actual value of individual arguments from an arguments object returned by the arguments property of an executing function.


[function.]arguments[[0|1|2|...|n]]

Arguments

  • function
    Optional. The name of the currently executing Function object.
  • 0, 1, 2, , n
    Required. Non-negative integer in the range of 0 to n where 0 represents the first argument and n represents the final argument. The value of the final argument n is arguments.length-1.

Remarks

The values returned by the 0 . . . n properties are the actual values passed to the executing function. While not actually an array of arguments, the individual arguments that comprise the arguments object are accessed the same way that array elements are accessed.

Example

The following example illustrates the use of the 0 . . . n properties of the arguments object. To fully understand the example, pass one or more arguments to the function:

function ArgTest(){

   var s = "";

   s += "The individual arguments are: "

   for (n=0; n< arguments.length; n++){

      s += ArgTest.arguments[n];

      s += " ";

   }

   return(s);

}

print(ArgTest(1, 2, "hello", new Date()));

Requirements

Version 5.5

Applies To: arguments Object (JScript 5.6)| Function Object (JScript 5.6)

See Also

Reference

length Property (arguments) (JScript 5.6)
length Property (Function) (JScript 5.6)