Skip to content

Commit 56dcba2

Browse files
authored
fix(operators): statement -> expression (#1165)
1 parent 80f0adb commit 56dcba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: 1-js/02-first-steps/08-operators/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ counter++;
443443

444444
逗号运算符 `,` 是最少见最不常使用的运算符之一。有时候它会被用来写更简短的代码,因此为了能够理解代码,我们需要了解它。
445445

446-
逗号运算符能让我们处理多个语句,使用 `,` 将它们分开。每个语句都运行了,但是只有最后的语句的结果会被返回
446+
逗号运算符能让我们处理多个表达式,使用 `,` 将它们分开。每个表达式都运行了,但是只有最后一个的结果会被返回
447447

448448
举个例子:
449449

@@ -455,7 +455,7 @@ let a = (1 + 2, 3 + 4);
455455
alert( a ); // 7(3 + 4 的结果)
456456
```
457457

458-
这里,第一个语句 `1 + 2` 运行了,但是它的结果被丢弃了。随后计算 `3 + 4`,并且该计算结果被返回。
458+
这里,第一个表达式 `1 + 2` 运行了,但是它的结果被丢弃了。随后计算 `3 + 4`,并且该计算结果被返回。
459459

460460
```smart header="逗号运算符的优先级非常低"
461461
请注意逗号运算符的优先级非常低,比 `=` 还要低,因此上面你的例子中圆括号非常重要。

0 commit comments

Comments
 (0)