A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/arguments below:

arguments · WebPlatform Docs

arguments Summary

An object representing the arguments to the currently executing function, and the functions that called it.

Syntax
[ function . ] arguments[ n ]
function
Optional. The name of the currently executing Function object.
n
Required. The zero-based index to argument values passed to the Function object.
Examples

The following example illustrates the use of the arguments object.

function ArgTest(a, b)
 {
    var s = "";

    s += "Expected Arguments: " + ArgTest.length;
    s += "<br />";
    s += "Passed Arguments: " + arguments.length;
    s += "<br />";

    s += "The individual arguments are: "
    for (n = 0; n < arguments.length; n++)
    {
       s += ArgTest.arguments[n];
       s += " ";
    }

    document.write(s);
 }

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

 
 
 
 
Remarks

You cannot explicitly create an arguments object. The arguments object only becomes available when a function begins execution. The arguments object of the function is not an array, but the individual arguments are accessed the same way array elements are accessed. The index n is actually a reference to one of the 0 n properties of the arguments object.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4