<html>
<link rel="stylesheet" href="josh.css">
<body bgcolor="#FFFFFF">

		<div id="Description">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">arguments</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">3</span> IE <span class="emphasis">4</span> ECMA <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Every functionwhile it is executinghas an
<span class="literal">arguments</span> object, which is accessible as a
property of the function. The object is created automatically, and
cannot be created outside of the function context that owns it. For
example, consider a typical function definition:
</p>
<span class="PROGRAMLISTING"><pre>function myFunc( ) &#123;
     // function statements
&#125;</pre></span>
							</td>
						</tr>
    <tr>
      <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
    </tr>
						<tr>
							<td colspan="2"><p>			A statement inside the function can access the
<span class="literal">arguments</span> object by the following reference:
</p>
<span class="PROGRAMLISTING"><pre>arguments</pre></span>
							</td>
						</tr>
    <tr>
      <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
    </tr>
						<tr>
							<td colspan="2"><p>			This object always contains the <span class="literal">callee</span> property,
which is a reference to the very same function (explained in the
<span class="literal">callee</span> property discussion). But you can also use
the <span class="literal">arguments</span> object to access each parameter
variable value through array notation. In the above example, a
statement inside the <span class="literal">myFunc( )</span> function can access
the passed parameter value with the following reference:
</p>
<span class="PROGRAMLISTING"><pre>arguments[0]</pre></span>
							</td>
						</tr>
    <tr>
      <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
    </tr>
						<tr>
							<td colspan="2"><p>			See the <span class="literal">arguments</span> property discussion of the
<span class="literal">Function</span> object later in this chapter for
practical applications.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="properties"><span class="title">Properties</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table border="1"><tbody><tr><td><span class="literal">callee</span></td><td> <span class="literal">length</span></td>
								</tr>
							</tbody></table>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="methods"><span class="title">Methods</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			None.</p>
					</td>
				</tr>
			</table>
		</div><div id="callee">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">callee</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">5(Mac)/5.5(Win)</span> ECMA <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">Read-only&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provides a reference to the function that created the
<span class="literal">arguments</span> object. This property provides the
essential reference to the current function, which an anonymous
function would require for it to be called in a recursive
construction.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>myObj.doThis = function(input) &#123;
      // function statements that act on parameter value
      if (!someCondition) {
           arguments.callee(input);
      }
}</pre>
						</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="value"><span class="title">Value</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			Function object reference.</p>
					</td>
				</tr>
			</table>
		</div><div id="length">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">length</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">3</span> IE <span class="emphasis">4</span> ECMA <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">Read-only&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Returns the number of arguments passed to the function in its current
invocation. The number is not influenced by the number of parameter
variables defined for the function.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>function myFunc( ) &#123;
    for (var i = 0; i &lt; arguments.length; i++) {
        ...
    }
}</pre>
						</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="value"><span class="title">Value</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			Integer.</p>
					</td>
				</tr>
			</table>
		</div>

</body>
</html>