mozilla

Revision 32590 of Boolean.prototype

  • Revision slug: JavaScript/Reference/Global_Objects/Boolean/prototype
  • Revision title: prototype
  • Revision id: 32590
  • Created:
  • Creator: Sevenspade
  • Is current revision? No
  • Comment %s/\(en\|Junk\)\/Core[ _]JavaScript[ _]1\.5[ _]Reference/en\/JavaScript\/Reference/g; one or more formatting changes

Revision Content

Summary

Represents the prototype for the Boolean constructor.

Description

Boolean instances inherit from Boolean.prototype. You can use the constructor's prototype object to add properties or methods to all Boolean instances.

Properties

constructor
Returns the function that created an instance's prototype. This is the Boolean function by default.
{{ jsOverrides("Object", "properties", ["constructor"]) }}

Methods

toSource
Returns a string containing the source of the Boolean object; you can use this string to create an equivalent object. Overrides the Object.prototype.toSource method.
toString
Returns a string of either "true" or "false" depending upon the value of the object. Overrides the Object.prototype.toStringmethod.
valueOf
Returns the primitive value of the Boolean object. Overrides the Object.prototype.valueOf method.
{{ jsOverrides("Object", "methods", ["toSource", "toString", "valueOf"]) }}

{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Boolean/prototype", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/prototype", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Boolean/prototype" } ) }}

Revision Source

<h2 name="Summary">Summary</h2>
<p>Represents the prototype for the <a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global_Objects/Boolean"><code>Boolean</code></a> constructor.</p>
<h2 name="Description">Description</h2>
<p><a class="internal" href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean"><code>Boolean</code></a> instances inherit from <a class="internal" href="/en/JavaScript/Reference/Global_Objects/Boolean/prototype" title="en/JavaScript/Reference/Global Objects/Boolean/Prototype"><code>Boolean.prototype</code></a>. You can use the constructor's prototype object to add properties or methods to all <code>Boolean</code> instances.</p>
<h2>Properties</h2>
<dl> <dt><a href="/en/JavaScript/Reference/Global_Objects/Boolean/constructor" title="en/JavaScript/Reference/Global_Objects/Boolean/constructor"><code>constructor</code></a></dt> <dd>Returns the function that created an instance's prototype. This is the <a class="internal" href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean"><code>Boolean</code></a> function by default.</dd>
</dl>
<div>{{ jsOverrides("Object", "properties", ["constructor"]) }}</div>
<h2>Methods</h2>
<dl> <dt><a href="/en/JavaScript/Reference/Global_Objects/Boolean/toSource" title="en/JavaScript/Reference/Global_Objects/Boolean/toSource">toSource</a></dt> <dd>Returns a string containing the source of the <a class="internal" href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean"><code>Boolean</code></a> object; you can use this string to create an equivalent object. Overrides the <a href="/en/JavaScript/Reference/Global_Objects/Object/toSource" title="en/JavaScript/Reference/Global_Objects/Object/toSource"><code>Object.prototype.toSource</code></a> method.</dd>
</dl>
<dl> <dt><a href="/en/JavaScript/Reference/Global_Objects/Boolean/toString" title="en/JavaScript/Reference/Global_Objects/Boolean/toString"><code>toString</code></a></dt> <dd>Returns a string of either "true" or "false" depending upon the value of the object. Overrides the <a href="/en/JavaScript/Reference/Global_Objects/Object/toString" title="en/JavaScript/Reference/Global_Objects/Object/toString"><code>Object.prototype.toString</code></a>method.</dd>
</dl>
<dl> <dt><a href="/en/JavaScript/Reference/Global_Objects/Boolean/valueOf" title="en/JavaScript/Reference/Global_Objects/Boolean/valueOf"><code>valueOf</code></a></dt> <dd>Returns the primitive value of the <a class="internal" href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean"><code>Boolean</code></a> object. Overrides the <a href="/en/JavaScript/Reference/Global_Objects/Object/valueOf" title="en/JavaScript/Reference/Global_Objects/Object/valueOf"><code>Object.prototype.valueOf</code></a> method.</dd>
</dl>
<div>{{ jsOverrides("Object", "methods", ["toSource", "toString", "valueOf"]) }}</div>
<p>{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Boolean/prototype", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/prototype", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Boolean/prototype" } ) }}</p>
Revert to this revision