aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/statements/break/index.html
diff options
context:
space:
mode:
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.html14
1 files changed, 7 insertions, 7 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 25d8964e32..c0297dbb86 100644
--- a/files/zh-cn/web/javascript/reference/statements/break/index.html
+++ b/files/zh-cn/web/javascript/reference/statements/break/index.html
@@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
<h2 id="语法">语法</h2>
-<pre class="syntaxbox notranslate"><code>break [label];</code></pre>
+<pre class="syntaxbox"><code>break [label];</code></pre>
<dl>
<dt><code>label</code> {{optional_inline}}</dt>
@@ -33,7 +33,7 @@ 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">function testBreak(x) {
+<pre class="brush: js"><code class="language-js">function testBreak(x) {
var i = 0;
while (i &lt; 6) {
@@ -50,7 +50,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
<p>在下面的代码中, <code>break</code> 使用在 {{jsxref("Statements/switch", "switch")}} 语句中,当遇到匹配到case后,就会执行相应的代码并中断循环体。</p>
-<pre class="notranslate">const food = "sushi";
+<pre>const food = "sushi";
switch (food) {
case "sushi":
@@ -68,7 +68,7 @@ switch (food) {
<p>下面的代码中一起使用 <code>break</code> 语句和被标记的块语句。一个 <code>break</code> 语句必须内嵌在它引用的标记中。注意,<code>inner_block</code> 内嵌在 <code>outer_block</code> 中。</p>
-<pre class="brush:js;highlight:[1,3,5]; notranslate">outer_block:{
+<pre class="brush:js;highlight:[1,3,5];">outer_block:{
inner_block:{
console.log ('1');
@@ -84,7 +84,7 @@ switch (food) {
<p>下面的代码同样使用了 <code>break</code> 语句和被标记的块语句,但是产生了一个语法错误,因为它的 <code>break</code> 语句在 <code>block_1</code> 中,但是引用了 <code>block_2</code>。<code>break</code> 语句必须内嵌在它引用的标签中。</p>
-<pre class="brush:js;highlight:[1,3,6]; notranslate">block_1:{
+<pre class="brush:js;highlight:[1,3,6];">block_1:{
console.log ('1');
break block_2; // SyntaxError: label not found
}
@@ -98,7 +98,7 @@ block_2:{
<p>在下面的代码同样会产生SyntaxError,因为它并没被正确的使用在循环、switch或label语句中。</p>
-<pre class="notranslate">function testBreak(x) {
+<pre>function testBreak(x) {
var i = 0;
while (i &lt; 6) {
@@ -116,7 +116,7 @@ return i * x;
testBreak(1); // SyntaxError: Illegal break statement
</pre>
-<pre class="notranslate">block_1: {
+<pre>block_1: {
console.log('1');
( function() {
break block_1; // SyntaxError: Undefined label 'block_1'