diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html b/files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html new file mode 100644 index 0000000000..3ed14e1397 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/number/tosource/index.html @@ -0,0 +1,80 @@ +--- +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" name="Summary">概述</h2> +<p><code><strong>toSource()</strong></code> 方法返回该对象源码的字符串表示。</p> +<h2 id="Syntax" name="Syntax">语法</h2> +<pre class="syntaxbox">numObj.toSource(); +Number.toSource(); +</pre> +<h3 id="Parameters" name="Parameters">参数</h3> +<p>无</p> +<h2 id="Description" name="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> +<p>{{ CompatibilityTable() }}</p> +<div id="compat-desktop"> + <table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<div id="compat-mobile"> + <table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<h2 id="See_Also" name="See_Also">相关链接</h2> +<ul> + <li>{{jsxref("Object.prototype.toSource()")}}</li> +</ul> |
