mozilla

Compare Revisions

Object.prototype.toString()

Change Revisions

Revision 315549:

Revision 315549 by trevorh on

Revision 316399:

Revision 316399 by ethertank on

Title:
toString
Object.toString
Slug:
JavaScript/Reference/Global_Objects/Object/toString
JavaScript/Reference/Global_Objects/Object/toString
Tags:
"String Methods", "JavaScript Reference", "JavaScript"
"String Methods", "JavaScript Reference", "JavaScript"
Content:

Revision 315549
Revision 316399
n7    <h3 id="Summary" name="Summary">n7    <h2 id="Summary" name="Summary">
n9    </h3>n9    </h2>
n17            Method of <a href="/en-US/docs/JavaScript/Reference/Gn17            Method of <a href="/en-US/docs/JavaScript/Reference/G
>lobal_Objects/Object" title="en/JavaScript/Reference/Global_Objec>lobal_Objects/Object" title="JavaScript/Reference/Global_Objects/
>ts/Object"><code>Object</code></a>>Object"><code>Object</code></a>
n40    <h3 id="Syntax" name="Syntax">n40    <h2 id="Syntax" name="Syntax">
n42    </h3>n42    </h2>
43    <p>43    <pre class="syntaxbox">
44      <code><em>object</em>.toString()</code>44<code><em>object</em>.toString()</code>
45    </p>45</pre>
46    <h3 id="Description" name="Description">46    <h2 id="Description" name="Description">
n48    </h3>n48    </h2>
n52    <pre class="eval">n52    <pre class="brush:js">
n57      Starting in JavaScript 1.8.5 <code>toString()</code> calledn57      Starting in JavaScript 1.8.5 <code>toString()</code> called
> on <code>null</code> returns <code>[object <em>Null</em>]</code>> on <code>null</code> returns <code>[object <em>Null</em>]</code>
>, and <code>undefined</code> returns <code>[object <em>Undefined<>, and <code>undefined</code> returns <code>[object <em>Undefined<
>/em>]</code>, as defined in the 5th Edition of ECMAScript and a s>/em>]</code>, as defined in the 5th Edition of ECMAScript and a s
>ubsequent Errata. See <a href="/en-US/docs/JavaScript/Reference/G>ubsequent Errata. See <a href="/en-US/docs/JavaScript/Reference/G
>lobal_Objects/Object/toString#Using_toString_to_detect_object_typ>lobal_Objects/Object/toString#Using_toString_to_detect_object_typ
>e" title="en/JavaScript/Reference/Global Objects/Object/toString#>e" title="JavaScript/Reference/Global Objects/Object/toString#Usi
>Using toString to detect object type">Using toString to detect ob>ng toString to detect object type">Using toString to detect objec
>ject type</a>.>t type</a>.
n59    <h3 id="Examples" name="Examples">n59    <h2 id="Examples" name="Examples">
nn61    </h2>
62    <h3 id="Overriding_the_default_toString_method" name="Overrid
 >ing_the_default_toString_method">
63      Overriding the default <code>toString</code> method
n62    <h4 id="Overriding_the_default_toString_method" name="Overridn
>ing_the_default_toString_method"> 
63      Overriding the default <code>toString</code> method
64    </h4>
n84    <pre class="eval">n84    <pre>
n99    <pre class="eval">n99    <pre>
n102    <h4 id="Using_toString_to_detect_object_type" name="Using_toSn102    <h3 id="Using_toString_to_detect_object_type" name="Using_toS
>tring_to_detect_object_type">>tring_to_detect_object_type">
n104    </h4>n104    </h3>
n119    <h3 id="See_Also" name="See_Also">n119    <h2 id="See_also" name="See_also">
120      See Also120      See also
121    </h3>121    </h2>
n124        <a href="/en-US/docs/JavaScript/Reference/Global_Objects/n124        <a href="/en-US/docs/JavaScript/Reference/Global_Objects/
>Object/toSource" title="en/JavaScript/Reference/Global_Objects/Ob>Object/toSource" title="JavaScript/Reference/Global_Objects/Objec
>ject/toSource">toSource</a>>t/toSource">toSource</a>
t127        <a href="/en-US/docs/JavaScript/Reference/Global_Objects/t127        <a href="/en-US/docs/JavaScript/Reference/Global_Objects/
>Object/valueOf" title="en/JavaScript/Reference/Global_Objects/Obj>Object/valueOf" title="JavaScript/Reference/Global_Objects/Object
>ect/valueOf">valueOf</a>>/valueOf">valueOf</a>

Back to History