aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/statements/break/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/web/javascript/reference/statements/break/index.html')
-rw-r--r--files/zh-tw/web/javascript/reference/statements/break/index.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-tw/web/javascript/reference/statements/break/index.html b/files/zh-tw/web/javascript/reference/statements/break/index.html
index ff72f9d25b..b5fa73113e 100644
--- a/files/zh-tw/web/javascript/reference/statements/break/index.html
+++ b/files/zh-tw/web/javascript/reference/statements/break/index.html
@@ -25,13 +25,13 @@ translation_of: Web/JavaScript/Reference/Statements/break
<h2 id="說明">說明</h2>
-<p>中斷陳述 <code>break</code> 可加上標籤 (label) 參數,使其跳出被標籤的陳述語句。此中斷陳述 <code>break</code> 必須被包含在被標籤的陳述語句中。被標籤的陳述語句可被添加於任一個區塊 (<a class="internal" href="/en-US/docs/JavaScript/Reference/Statements/block" title="JavaScript/Reference/Statements/Block">block</a>) 前,而非限定在迴圈陳述。</p>
+<p>中斷陳述 <code>break</code> 可加上標籤 (label) 參數,使其跳出被標籤的陳述語句。此中斷陳述 <code>break</code> 必須被包含在被標籤的陳述語句中。被標籤的陳述語句可被添加於任一個區塊 (<a href="/en-US/docs/JavaScript/Reference/Statements/block" title="JavaScript/Reference/Statements/Block">block</a>) 前,而非限定在迴圈陳述。</p>
<h2 id="範例">範例</h2>
<p>下面函式包含一個中斷陳述 <code>break</code> ,當 <code>i</code> 值為 3 時,中斷 <code>while</code> 迴圈,並回傳 <code>3 * x</code> 。</p>
-<pre class="brush:js;highlight:[6];">function testBreak(x) {
+<pre class="brush:js">function testBreak(x) {
var i = 0;
while (i &lt; 6) {
@@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
<p>The following code uses <code>break</code> statements with labeled blocks. A <code>break</code> statement must be nested within any label it references. Notice that <code>inner_block</code> is nested within <code>outer_block</code>.</p>
-<pre class="brush:js;highlight:[1,2,4];">outer_block: {
+<pre class="brush:js">outer_block: {
inner_block: {
console.log('1');
break outer_block; // breaks out of both inner_block and outer_block
@@ -58,7 +58,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
<p>The following code also uses <code>break</code> statements with labeled blocks but generates a Syntax Error because its <code>break</code> statement is within <code>block_1</code> but references <code>block_2</code>. A <code>break</code> statement must always be nested within any label it references.</p>
-<pre class="brush:js;highlight:[1,3,6];">block_1: {
+<pre class="brush:js">block_1: {
console.log('1');
break block_2; // SyntaxError: label not found
}