Skip to content

Commit ce3d7a6

Browse files
lenchen1112ArvinH
andauthored
Operators (#21)
* Operators * chore: punctuation mark Co-Authored-By: ArvinH <[email protected]>
1 parent dc6a7fb commit ce3d7a6

File tree

5 files changed

+153
-152
lines changed

5 files changed

+153
-152
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
The answer is:
1+
答案是:
32

43
- `a = 2`
54
- `b = 2`
@@ -9,10 +8,10 @@ The answer is:
98
```js run no-beautify
109
let a = 1, b = 1;
1110

12-
alert( ++a ); // 2, prefix form returns the new value
13-
alert( b++ ); // 1, postfix form returns the old value
11+
alert( ++a ); // 2,前置型式回傳新的值
12+
alert( b++ ); // 1,後置型式回傳舊的值
1413

15-
alert( a ); // 2, incremented once
16-
alert( b ); // 2, incremented once
14+
alert( a ); // 2,遞增一次
15+
alert( b ); // 2,遞增一次
1716
```
1817

1-js/02-first-steps/07-operators/1-increment-order/task.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ importance: 5
22

33
---
44

5-
# The postfix and prefix forms
5+
# 後置與前置型式
66

7-
What are the final values of all variables `a`, `b`, `c` and `d` after the code below?
7+
下面程式碼執行後,`a``b``c` `d` 變數們內最後的值是什麼?
88

99
```js
1010
let a = 1, b = 1;
1111

1212
let c = ++a; // ?
1313
let d = b++; // ?
1414
```
15+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The answer is:
1+
答案是:
22

3-
- `a = 4` (multiplied by 2)
4-
- `x = 5` (calculated as 1 + 4)
3+
- `a = 4`(乘以 2)
4+
- `x = 5`(視為 1 + 4 計算)
55

1-js/02-first-steps/07-operators/2-assignment-result/task.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ importance: 3
22

33
---
44

5-
# Assignment result
5+
# 指定後的結果
66

7-
What are the values of `a` and `x` after the code below?
7+
下面程式碼執行後,`a` `x` 的值會是什麼?
88

99
```js
1010
let a = 2;
1111

1212
let x = 1 + (a *= 2);
1313
```
14+

0 commit comments

Comments
 (0)