aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/statements/break/index.html
diff options
context:
space:
mode:
authorIrvin <irvinfly@gmail.com>2022-02-16 02:07:31 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commitd9e9adb5f80a819fe46349bcf6d1faec734b09cd (patch)
treee856dc5e31aad0a7d5e8c2f98c9ee139d9569a86 /files/zh-cn/web/javascript/reference/statements/break/index.html
parent7c2556fe79c44d7c31108b8c8b048d2b7704a95e (diff)
downloadtranslated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.tar.gz
translated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.tar.bz2
translated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.zip
remove span tag in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/statements/break/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/statements/break/index.html24
1 files changed, 12 insertions, 12 deletions
diff --git a/files/zh-cn/web/javascript/reference/statements/break/index.html b/files/zh-cn/web/javascript/reference/statements/break/index.html
index 8714bc8c29..25d8964e32 100644
--- a/files/zh-cn/web/javascript/reference/statements/break/index.html
+++ b/files/zh-cn/web/javascript/reference/statements/break/index.html
@@ -33,18 +33,18 @@ translation_of: Web/JavaScript/Reference/Statements/break
<p>下面的函数里有个 <code>break</code> 语句,当 <code>i</code> 为 3 时,会中止 {{jsxref("Statements/while", "while")}} 循环,然后返回 3 * <code>x</code> 的值。</p>
-<pre class="brush: js notranslate"><code class="language-js"><span class="keyword token">function</span> <span class="function token">testBreak</span><span class="punctuation token">(</span>x<span class="punctuation token">)</span> <span class="punctuation token">{</span>
- <span class="keyword token">var</span> i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">;</span>
-
- <span class="keyword token">while</span> <span class="punctuation token">(</span>i <span class="operator token">&lt;</span> <span class="number token">6</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
- <span class="keyword token">if</span> <span class="punctuation token">(</span>i <span class="operator token">==</span> <span class="number token">3</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
- <span class="keyword token">break</span><span class="punctuation token">;</span>
- <span class="punctuation token">}</span>
- i <span class="operator token">+</span><span class="operator token">=</span> <span class="number token">1</span><span class="punctuation token">;</span>
- <span class="punctuation token">}</span>
-
- <span class="keyword token">return</span> i <span class="operator token">*</span> x<span class="punctuation token">;</span>
-<span class="punctuation token">}</span></code></pre>
+<pre class="brush: js notranslate"><code class="language-js">function testBreak(x) {
+ var i = 0;
+
+ while (i &lt; 6) {
+ if (i == 3) {
+ break;
+ }
+ i += 1;
+ }
+
+ return i * x;
+}</code></pre>
<h3 id="break_in_switch_statements">break in switch statements</h3>