mozilla

Compare Revisions

Object.prototype.valueOf()

Change Revisions

Revision 264697:

Revision 264697 by Sevenspade on

Revision 264769:

Revision 264769 by gary.court on

Title:
valueOf
JavaScript/Reference/Global_Objects/Object/valueOf
Slug:
JavaScript/Reference/Global_Objects/Object/valueOf
JavaScript/Reference/Global_Objects/Object/valueOf
Tags:
JavaScript, "JavaScript Reference", Object
JavaScript, "JavaScript Reference", Object
Content:

Revision 264697
Revision 264769
n10    <h3 name="Summary">n10    <h3 id="Summary" name="Summary">
n20            Method of <a href="/en/JavaScript/Reference/Global_Obn20            Method of <a href="/en/JavaScript/Reference/Global_Ob
>jects/Object"><code>Object</code></a>>jects/Object" title="en/JavaScript/Reference/Global_Objects/Objec
 >t"><code>Object</code></a>
n43    <h3 name="Syntax">n43    <h3 id="Syntax" name="Syntax">
n49    <h3 name="Parameters">n49    <h3 id="Parameters" name="Parameters">
n55    <h3 name="Description">n55    <h3 id="Description" name="Description">
n68      You can use <code>valueOf</code> within your own code to con68      You can use <code>valueOf</code> within your own code to co
>nvert a built-in object into a primitive value. When you create a>nvert a built-in object into a primitive value. When you create a
> custom object, you can override <code>Object.valueOf</code> to c> custom object, you can override <code>Object.prototype.valueOf</
>all a custom method instead of the default <code>Object</code> me>code> to call a custom method instead of the default <code>Object
>thod.></code> method.
n70    <h4 name="Overriding_valueOf_for_custom_objects">n70    <h4 id="Overriding_valueOf_for_custom_objects" name="Overridi
 >ng_valueOf_for_custom_objects">
n80myNumberType.prototype.valueOf = new Function(functionText)n80myNumberType.prototype.valueOf = function () { return customPrimi
 >tiveValue; };
n91    <h4 name="Note">n91    <h4 id="Note" name="Note">
t97    <h3 name="See_Also">t97    <h3 id="See_Also" name="See_Also">

Back to History