<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">instanceof</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">5(Win)</span> ECMA <span class="emphasis">n/a</span></td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements"></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>The <span class="literal">instanceof</span> operator lets scripts determine if
an object (the left operand) is an instance of a known object (or
inherited from the known object). In some ways, this operator is like
the <span class="literal">typeof</span> operator, but rather than returning a
broad object type, an expression with the
<span class="literal">instanceof</span> operator returns a Boolean value
against your test for a more specific object type. In fact, you can
query an object against custom objects and, in Netscape 6, W3C DOM
tree object prototypes. Whereas the <span class="literal">typeof</span>
operator on an array returns <span class="literal">object</span>, you can find
out if an object was instantiated specifically as an array:
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			Note, however, that if the above expression evaluates to
<span class="literal">true</span>, so does:
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			An array is a descendant of the root <span class="literal">Object</span>
object, and is thus an instance of that root object, as well.
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			In Netscape 6, either or both operands can also be references to DOM
prototype objects. Therefore, the following expression is legal and
operational in Netscape 6:
</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>if (theVal instanceof Array) {
    // go ahead and treat theVal as an array
}</pre>
						</span></td>
				</tr>
			</table>
		</div>

</body>
</html>