mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-16 15:54:22 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
<h2 id="Summary" name="Summary">概述</h2>
|
||||
<p><code><strong>toString()</strong></code> 方法返回指定对象的字符串形式。</p>
|
||||
<h2 id="Syntax" name="Syntax">语法</h2>
|
||||
<pre class="syntaxbox"><code><em>str</em>.toString()</code></pre>
|
||||
<pre><code class="language-javascript"><code><em>str</em>.toString()</code></code></pre>
|
||||
<h2 id="Description" name="Description">描述</h2>
|
||||
<p><code>String</code> 对象覆盖了<a href="Reference/Global_Objects/Object" title="Object 构造函数创建一个对象包装器。"><code>Object</code></a> 对象的 <code>toString</code> 方法;并没有继承 <a href="Reference/Global_Objects/Object/toString" title="toString() 方法返回一个表示该对象的字符串。"><code>Object.toString()</code></a>。对于 <code>String</code> 对象,<code>toString</code> 方法返回该对象的字符串形式,和 <a href="Reference/Global_Objects/String/valueOf" title="valueOf() 方法返回一个String对象的原始值(primitive value)。"><code>String.prototype.valueOf()</code></a> 方法返回值一样。</p>
|
||||
<h2 id="Examples" name="Examples">示例</h2>
|
||||
<h3 id="Example:_Using_toString" name="Example:_Using_toString">例子:使用 <code>toString</code></h3>
|
||||
<p>下例输出一个字符串对象(String object)的字符串值:</p>
|
||||
<pre class="brush:js">var x = new String("Hello world");
|
||||
<pre><code class="language-js">var x = new String("Hello world");
|
||||
|
||||
alert(x.toString()) // 输出 "Hello world"</pre>
|
||||
alert(x.toString()) // 输出 "Hello world"</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user