mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-15 23:37:25 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div></div>
|
||||
<p><strong><code>concat()</code></strong> 方法将一个或多个字符串与原字符串连接合并,形成一个新的字符串并返回。</p>
|
||||
<h2 id="Syntax" name="Syntax">语法</h2>
|
||||
<pre><code><var>str</var>.concat(<var>string2</var>, <var>string3</var>[, ..., <var>stringN</var>])</code></pre>
|
||||
<pre><code><var>str</var>.concat(<var>string2</var>, <var>string3</var>[, ..., <var>stringN</var>])</code></code></pre>
|
||||
<h3 id="Parameters" name="Parameters">参数</h3>
|
||||
<dl>
|
||||
<dt><code>string2...string<em>N</em></code></dt>
|
||||
@@ -13,9 +13,9 @@
|
||||
<h2 id="Examples" name="Examples">示例</h2>
|
||||
<h3 id="Examples" name="Examples">例子:使用 <code>concat</code></h3>
|
||||
<p>下面的例子演示如何将多个字符串与原字符串合并为一个新字符串</p>
|
||||
<pre class="brush: js">var hello = "Hello, ";
|
||||
<pre><code class="language-javascript">var hello = "Hello, ";
|
||||
console.log(hello.concat("Kevin", " have a nice day.")); /* Hello, Kevin have a nice day. */
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="性能" style="margin-bottom: 20px; line-height: 30px;">性能</h2>
|
||||
<p>强烈建议使用 <a href="https://developer.mozilla.orgReference/Operators/Assignment_Operators">赋值操作符</a>(+, +=)代替 <code>concat</code> 方法。参看 <a class="external" href="http://jsperf.com/concat-vs-plus-vs-join" rel="noopener">性能测试(perfomance test)</a>。</p>
|
||||
<h2 id="规范">规范</h2>
|
||||
|
||||
Reference in New Issue
Block a user