diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/repeat')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html index b880c16b92..c0ee77fe21 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html @@ -20,7 +20,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat <h2 id="Syntax" name="Syntax">语法</h2> -<pre class="syntaxbox notranslate"><code><var>str</var>.repeat(<var>count</var>)</code></pre> +<pre class="syntaxbox"><code><var>str</var>.repeat(<var>count</var>)</code></pre> <h3 id="Parameters" name="Parameters">参数</h3> @@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat <p>此方法已添加到 ECMAScript 2015 规范中,并且可能尚未在所有 JavaScript 实现中可用。然而,你可以使用以下代码段对 String.prototype.repeat() 进行填充:</p> -<pre class="brush: js language-js notranslate"><code class="language-js">if (!String.prototype.repeat) { +<pre class="brush: js language-js"><code class="language-js">if (!String.prototype.repeat) { String.prototype.repeat = function(count) { 'use strict'; if (this == null) { @@ -88,7 +88,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat <h2 id="Examples" name="Examples">示例</h2> -<pre class="brush:js notranslate">"abc".repeat(-1) // RangeError: repeat count must be positive and less than inifinity +<pre class="brush:js">"abc".repeat(-1) // RangeError: repeat count must be positive and less than inifinity "abc".repeat(0) // "" "abc".repeat(1) // "abc" "abc".repeat(2) // "abcabc" |