spacer
Yehuda Shiran March 27, 2000
The arguments Array
Tips: March 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

The functionName.arguments array holds the arguments the were passed to the function functionName when it was last called. Here is an example:

function foo() {
  document.write(foo.arguments[2]);
}
foo(1, 2, 3, 4, 5);
foo();

The output of the script is:

3
3

The second 3 is not associated with the second foo() call, but rather with the first one. Since the second foo() call has no arguments, the arguments from the first foo() call still occupy the arguments array.

See an example for using the arguments array in Column 59, IE 5.5's Stack Support.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business