From 563ca0a35e98678e2b7d5f154f31f496851e8d60 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove code tag inside pre tag for zh-CN --- .../web/javascript/reference/statements/break/index.html | 4 ++-- .../web/javascript/reference/statements/continue/index.html | 12 ++++++------ .../web/javascript/reference/statements/debugger/index.html | 4 ++-- .../javascript/reference/statements/do...while/index.html | 6 +++--- .../web/javascript/reference/statements/function/index.html | 12 ++++++------ 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/statements') 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 c0297dbb86..a15c0bf7d9 100644 --- a/files/zh-cn/web/javascript/reference/statements/break/index.html +++ b/files/zh-cn/web/javascript/reference/statements/break/index.html @@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Statements/break

下面的函数里有个 break 语句,当 i 为 3 时,会中止 {{jsxref("Statements/while", "while")}} 循环,然后返回 3 * x 的值。

-
function testBreak(x) {
+
function testBreak(x) {
   var i = 0;
 
   while (i < 6) {
@@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
   }
 
   return i * x;
-}
+}

break in switch statements

diff --git a/files/zh-cn/web/javascript/reference/statements/continue/index.html b/files/zh-cn/web/javascript/reference/statements/continue/index.html index ce08e7f444..8d58c28a2b 100644 --- a/files/zh-cn/web/javascript/reference/statements/continue/index.html +++ b/files/zh-cn/web/javascript/reference/statements/continue/index.html @@ -43,7 +43,7 @@ translation_of: Web/JavaScript/Reference/Statements/continue

下述例子展示了一个在i 为 3时执行continue 语句的 {{jsxref("Statements/while", "while")}} 循环。因此,n 的值在几次迭代后分别为 1, 3, 7 和 12 .

-
i = 0;
+
i = 0;
 n = 0;
 while (i < 5) {
    i++;
@@ -51,7 +51,7 @@ while (i < 5) {
       continue;
    }
    n += i;
-}
+}

使用带 label 的 continue

@@ -61,7 +61,7 @@ while (i < 5) {

参考 {{jsxref("Statements/label", "label")}} 。

-
var i = 0,
+
var i = 0,
     j = 8;
 
 checkiandj: while (i < 4) {
@@ -77,11 +77,11 @@ checkiandj: while (i < 4) {
    }
    console.log("i = " + i);
    console.log("j = " + j);
-}
+}

输出:

-
"i: 0"
+
"i: 0"
 
 // start checkj
 "j: 8"
@@ -105,7 +105,7 @@ checkiandj: while (i < 4) {
 
 "i: 3"
 "i = 4"
-"j = 4"
+"j = 4"

规范

diff --git a/files/zh-cn/web/javascript/reference/statements/debugger/index.html b/files/zh-cn/web/javascript/reference/statements/debugger/index.html index 0018dc056c..0f07a5b799 100644 --- a/files/zh-cn/web/javascript/reference/statements/debugger/index.html +++ b/files/zh-cn/web/javascript/reference/statements/debugger/index.html @@ -19,10 +19,10 @@ translation_of: Web/JavaScript/Reference/Statements/debugger

下面的例子演示了一个包含 debugger 语句的函数,当函数被调用时,会尝试调用一个可用的调试器进行调试。

-
function potentiallyBuggyCode() {
+
function potentiallyBuggyCode() {
     debugger;
     // do potentially buggy stuff to examine, step through, etc.
-}
+}

当 debugger 被调用时, 执行暂停在 debugger 语句的位置。就像在脚本源代码中的断点一样。

diff --git a/files/zh-cn/web/javascript/reference/statements/do...while/index.html b/files/zh-cn/web/javascript/reference/statements/do...while/index.html index 89a850f722..614ef2ad4b 100644 --- a/files/zh-cn/web/javascript/reference/statements/do...while/index.html +++ b/files/zh-cn/web/javascript/reference/statements/do...while/index.html @@ -37,17 +37,17 @@ while (condition);

HTML 内容

-
<div id="example"></div>
+
<div id="example"></div>

JavaScript 内容

-
var result = '';
+
var result = '';
 var i = 0;
 do {
    i += 1;
    result += i + ' ';
 } while (i < 5);
-document.getElementById('example').innerHTML = result;
+document.getElementById('example').innerHTML = result;

结果

diff --git a/files/zh-cn/web/javascript/reference/statements/function/index.html b/files/zh-cn/web/javascript/reference/statements/function/index.html index be8920fca8..ef61d65141 100644 --- a/files/zh-cn/web/javascript/reference/statements/function/index.html +++ b/files/zh-cn/web/javascript/reference/statements/function/index.html @@ -96,23 +96,23 @@ if (true) {

JavaScript 中的函数声明被提升到了函数定义。你可以在函数声明之前使用该函数:

-
hoisted(); // logs "foo"
+
hoisted(); // logs "foo"
 
 function hoisted() {
   console.log('foo');
-}
+}
 

注意 :函数表达式{{jsxref("Operators/function", "function expressions")}} 不会被提升:

-
notHoisted(); // TypeError: notHoisted is not a function
+
notHoisted(); // TypeError: notHoisted is not a function
 
 var notHoisted = function() {
   console.log('bar');
 };
-
+

示例

@@ -120,9 +120,9 @@ var notHoisted = function() {

下面的代码声明了一个函数,该函数返回了销售的总金额, 参数是产品a,b,c分别的销售的数量.

-
function calc_sales(units_a, units_b, units_c) {functionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunction
+
function calc_sales(units_a, units_b, units_c) {functionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunctionfunction
    return units_a*79 + units_b * 129 + units_c * 699;
-}
+}

规范

-- cgit v1.2.3-54-g00ecf