aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html
blob: 87b075c6f875507aae0b897f457e0a10a866c821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
title: Number.prototype.toSource()
slug: Web/JavaScript/Reference/Global_Objects/Number/toSource
translation_of: Web/JavaScript/Reference/Global_Objects/Number/toSource
---
<div>
 {{JSRef("Global_Objects", "Number")}} {{ Non-standard_header() }}</div>
<h2 id="Summary">概述</h2>
<p><code><strong>toSource()</strong></code> 方法返回该对象源码的字符串表示。</p>
<h2 id="Syntax">语法</h2>
<pre class="syntaxbox">numObj.toSource();
Number.toSource();
</pre>
<h3 id="Parameters">参数</h3>
<p></p>
<h2 id="Description">描述</h2>
<p><code>toSource()</code> 方法返回下列值:</p>

<ul>
 <li>对于内置 <code>Number</code> 对象, <code>toSource()</code> 返回下面字符串,用来指明源码是不可见的。</li>
</ul>
<pre class="eval">function Number() { [native code] }</pre>
<ul>
 <li>对于 <code>Number</code> 对象的实例,<code>toSource()</code> 返回一个表示源码的字符串。</li>
</ul>
<p>该方法通常被 JavaScript 内部调用,而不是在代码中显示调用。</p>
<h2 id="规范">规范</h2>
<p>不是任何标准的一部分。在 JavaScript 1.3 被实现。</p>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

{{Compat}}

<h2 id="See_Also">相关链接</h2>
<ul>
 <li>{{jsxref("Object.prototype.toSource()")}}</li>
</ul>