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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint