mozilla

Revision 32585 of Boolean.prototype

  • Revision slug: JavaScript/Reference/Global_Objects/Boolean/prototype
  • Revision title: prototype
  • Revision id: 32585
  • Created:
  • Creator: delae
  • Is current revision? No
  • Comment 35 words removed; page display name changed to 'prototype'

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.toString method.
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

<p> </p>
<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">Boolean</a> constructor.</p>
<h3 name="Description">Description</h3>
<div class="onlyinclude">
<div class="includeonly">
<p><a class="internal" href="/en/Core%20JavaScript%201.5%20Reference/Global%20Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean">Boolean</a> instances inherit from <a class="internal" href="/en/Core%20JavaScript%201.5%20Reference/Global%20Objects/Boolean/Prototype" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean/Prototype">Boolean.prototype</a>. You can use the constructor's prototype object to add properties or methods to all <a class="internal" href="/en/Core%20JavaScript%201.5%20Reference/Global%20Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean">Boolean</a> 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">constructor</a> </dt><dd> Returns the function that created an instance's prototype. This is the <a class="internal" href="/en/Core%20JavaScript%201.5%20Reference/Global%20Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean">Boolean</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%20JavaScript%201.5%20Reference/Global%20Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean">Boolean</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">Object.prototype.toSource</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">toString</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">Object.prototype.toString</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">valueOf</a> </dt><dd> Returns the primitive value of the <a class="internal" href="/en/Core%20JavaScript%201.5%20Reference/Global%20Objects/Boolean" title="en/Core JavaScript 1.5 Reference/Global Objects/Boolean">Boolean</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">Object.prototype.valueOf</a> method. </dd></dl> {{ JSInherits("Object", "Methods", "__defineGetter__", "__defineSetter__", "hasOwnProperty", "isPrototypeOf", "__lookupGetter__", "__lookupSetter__", "__noSuchMethod__", "propertyIsEnumerable", "unwatch", "watch") }}</div>
<p> </p>

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