mozilla

Revision 32587 of Boolean.prototype

  • Revision slug: JavaScript/Reference/Global_Objects/Boolean/prototype
  • Revision title: prototype
  • Revision id: 32587
  • Created:
  • Creator: Sevenspade
  • Is current revision? No
  • Comment no wording 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.

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.

{{ JSInherits("Object", "Methods", "__defineGetter__", "__defineSetter__", "hasOwnProperty", "isPrototypeOf", "__lookupGetter__", "__lookupSetter__", "__noSuchMethod__", "propertyIsEnumerable", "unwatch", "watch") }}

{{ 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

<h3 name="Summary">Summary</h3>
<p>Represents the prototype for the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean"><code>Boolean</code></a> constructor.</p>
<h3 name="Description">Description</h3>
<p><a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean"><code>Boolean</code></a> instances inherit from <a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/prototype" title="en/Core JavaScript 1.5 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>
<h4>Properties</h4>
<dl><dt><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/constructor" title="en/Core_JavaScript_1.5_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/Core_JavaScript_1.5_Reference/Global_Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean"><code>Boolean</code></a> function by default.</dd></dl>
<h4>Methods</h4>
<dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/toSource" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/toSource">toSource</a> </dt><dd> Returns a string containing the source of the <a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean"><code>Boolean</code></a> object; you can use this string to create an equivalent object. Overrides the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource"><code>Object.prototype.toSource</code></a> method.</dd></dl> <dl><dt><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/toString" title="en/Core_JavaScript_1.5_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/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString"><code>Object.prototype.toString</code></a>method.</dd></dl> <dl><dt><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/valueOf" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/valueOf"><code>valueOf</code></a></dt><dd>Returns the primitive value of the <a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean"><code>Boolean</code></a> object. Overrides the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf"><code>Object.prototype.valueOf</code></a> method.</dd></dl>
<p>{{ JSInherits("Object", "Methods", "__defineGetter__", "__defineSetter__", "hasOwnProperty", "isPrototypeOf", "__lookupGetter__", "__lookupSetter__", "__noSuchMethod__", "propertyIsEnumerable", "unwatch", "watch") }}</p>
<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