diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html index f8f9d021da..ff09cb22b0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html @@ -5,11 +5,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toString --- <div>{{JSRef("Global_Objects", "String")}}</div> -<h2 id="Summary" name="Summary">概述</h2> +<h2 id="Summary">概述</h2> <p><code><strong>toString()</strong></code> 方法返回指定对象的字符串形式。</p> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><em>str</em>.toString()</code> </pre> @@ -18,13 +18,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toString <p>一个表示调用对象的字符串。</p> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>String</code> 对象覆盖了{{jsxref("Global_Objects/Object", "Object")}} 对象的 <code>toString</code> 方法;并没有继承 {{jsxref("Object.toString()")}}。对于 <code>String</code> 对象,<code>toString</code> 方法返回该对象的字符串形式,和 {{jsxref("String.prototype.valueOf()")}} 方法返回值一样。</p> -<h2 id="Examples" name="Examples">示例</h2> +<h2 id="Examples">示例</h2> -<h3 id="Example_Using_toString" name="Example:_Using_toString">例子:使用 <code>toString</code></h3> +<h3 id="Example_Using_toString">例子:使用 <code>toString</code></h3> <p>下例输出一个字符串对象(String object)的字符串值:</p> @@ -116,7 +116,7 @@ alert(x.toString()) // 输出 "Hello world"</pre> </table> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Object.prototype.toSource()")}}</li> |