mozilla

Compare Revisions

Object.prototype.toString()

Change Revisions

Revision 61298:

Revision 61298 by evilpie on

Revision 61299:

Revision 61299 by evilpie on

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

Revision 61298
Revision 61299
n38            ECMA Version:n38            ECMAScript Edition:
nn41            <p>
41            ECMA-26242              ECMA-262
43            </p>
44            <p>
45              ECMA-262 5th Edition, revised in Errata
46            </p>
n63      Since JavaScript 1.8.5 <code>toString</code> called on <codn68      Since JavaScript 1.8.5 <code>toString</code> called on <cod
>e>null</code> returns <code>[object <em>Null</em>]</code>, and <c>e>null</code> returns <code>[object <em>Null</em>]</code>, and <c
>ode>undefined</code> returns <code>[object <em>Undefined</em>]</c>ode>undefined</code> returns <code>[object <em>Undefined</em>]</c
>ode>. See <a href="/en/Getting_started#Starting_a_new_page" title>ode>. See <a href="/en/JavaScript/Reference/Global_Objects/Object
>="en/Getting started#Starting a new page">Using toString to detec>/toString#Using_toString_to_detect_object_type" title="en/JavaScr
>t object type</a>.>ipt/Reference/Global Objects/Object/toString#Using toString to de
 >tect object type">Using toString to detect object type</a>.
tt131 
132//Since JavaScript 1.8.5
133toString.call(undefined); // [object Undefined]
134toString.call(null); // [object Null]

Back to History