MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 49342 of Number.prototype.toSource()

  • Revision slug: JavaScript/Reference/Global_Objects/Number/toSource
  • Revision title: toSource
  • Revision id: 49342
  • Created:
  • Creator: evilpie
  • Is current revision? No
  • Comment 3 words added, 3 words removed

Revision Content

{{ Non-standard_header() }}

Returns a string representing the source code of the object.

Method of Number
Implemented in 1.3
ECMAScript Edition none

Syntax

number.toSource()

Parameters

None.

Description

The toSource method returns the following values:

This shouldn't be here, but until reorganization where pages are moved to their proper places, the title of this article is ambiguous, so it can stay. After reorganization, this should be removed.

  • For the built-in Number object, toSource returns the following string indicating that the source code is not available:
function Number() {[native code]}
  • For instances of Number, toSource returns a string representing the source code.

This method is usually called internally by JavaScript and not explicitly in code.

See Also

Object.prototype.toSource

{{ languages( { "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Number/toSource" } ) }}

Revision Source

<p>
{{ Non-standard_header() }}
</p>
<p>Returns a string representing the source code of the object.
</p>
<table class="standard-table"> <thead> <tr> <th class="header" colspan="2">Method of <a href="/en/JavaScript/Reference/Global_Objects/Number"><code>Number</code></a></th> </tr> </thead> <tbody> <tr> <td>Implemented in</td> <td>1.3</td> </tr> <tr> <td>ECMAScript Edition</td> <td>none</td> </tr> </tbody>
</table> <h3 name="Syntax"> Syntax </h3>
<p><code><i>number</i>.toSource()</code>
</p>
<h3 name="Parameters"> Parameters </h3>
<p>None.
</p>
<h3 name="Description"> Description </h3>
<p>The <code>toSource</code> method returns the following values:
</p><p><span class="comment">This shouldn't be here, but until reorganization where pages are moved to their proper places, the title of this article is ambiguous, so it can stay. After reorganization, this should be removed.</span>
</p>
<ul><li> For the built-in <code>Number</code> object, <code>toSource</code> returns the following string indicating that the source code is not available:
</li></ul>
<pre class="eval">function Number() {[native code]}
</pre>
<ul><li> For instances of <code>Number</code>, <code>toSource</code> returns a string representing the source code.
</li></ul>
<p>This method is usually called internally by JavaScript and not explicitly in code.
</p>
<h3 name="See_Also"> See Also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource">Object.prototype.toSource</a>
</p>
<div class="noinclude">
</div>
{{ languages( { "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Number/toSource" } ) }}
Revert to this revision