Skip to content

Commit 8614b5a

Browse files
committed
fix: fix a typo in lydiahallie#122, remove duplicate question
1 parent 37a8551 commit 8614b5a

File tree

1 file changed

+8
-40
lines changed

1 file changed

+8
-40
lines changed

zh-CN/README-zh_CN.md

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,7 +3930,7 @@ console.log(!typeof name === "string");
39303930
39313931
`typeof name` 返回 `"string"`。字符串 `"string"` 是一个 truthy 的值,因此 `!typeof name` 返回一个布尔值 `false`。 `false === "object"` 和 `false === "string"` 都返回 `false`。
39323932
3933-
(如果我们想检测一个值的类型,我们不应该用 `!==` 而不是 `!typeof`)
3933+
(如果我们想检测一个值的类型,我们应该用 `!==` 而不是 `!typeof`)
39343934
39353935
</p>
39363936
</details>
@@ -4458,39 +4458,7 @@ Object.freeze(person);
44584458

44594459
---
44604460

4461-
###### 138. 以下哪一项会对对象 `person` 有副作用?
4462-
4463-
```javascript
4464-
const person = {
4465-
name: "Lydia Hallie",
4466-
address: {
4467-
street: "100 Main St"
4468-
}
4469-
};
4470-
4471-
Object.freeze(person);
4472-
```
4473-
4474-
- A: `person.name = "Evan Bacon"`
4475-
- B: `delete person.address`
4476-
- C: `person.address.street = "101 Main St"`
4477-
- D: `person.pet = { name: "Mara" }`
4478-
4479-
<details><summary><b>答案</b></summary>
4480-
<p>
4481-
4482-
#### 答案: C
4483-
4484-
使用方法 `Object.freeze` 对一个对象进行 _冻结_。不能对属性进行添加,修改,删除。
4485-
4486-
然而,它仅 对对象进行 _浅_ 冻结,意味着只有 对象中的 _直接_ 属性被冻结。如果属性是另一个 object,像案例中的 `address``address` 中的属性没有被冻结,仍然可以被修改。
4487-
4488-
</p>
4489-
</details>
4490-
4491-
---
4492-
4493-
###### 139. 输出什么?
4461+
###### 138. 输出什么?
44944462

44954463
```javascript
44964464
const add = x => x + x;
@@ -4522,7 +4490,7 @@ myFunc(3);
45224490

45234491
---
45244492

4525-
###### 140. 输出什么?
4493+
###### 139. 输出什么?
45264494

45274495
```javascript
45284496
class Counter {
@@ -4560,7 +4528,7 @@ console.log(counter.#number)
45604528

45614529
---
45624530

4563-
###### 141. 选择哪一个?
4531+
###### 140. 选择哪一个?
45644532

45654533
```javascript
45664534
const teams = [
@@ -4604,7 +4572,7 @@ obj.next(); // { value: "Lisa", done: false }
46044572

46054573
---
46064574

4607-
###### 142. 输出什么?
4575+
###### 141. 输出什么?
46084576

46094577
```javascript
46104578
const person = {
@@ -4649,7 +4617,7 @@ pushing `dancing` 和 `baking` 之后,`person.hobbies` 的值为 `["coding", "
46494617

46504618
---
46514619

4652-
###### 143. 输出什么?
4620+
###### 142. 输出什么?
46534621

46544622
```javascript
46554623
class Bird {
@@ -4685,7 +4653,7 @@ const pet = new Flamingo();
46854653
46864654
---
46874655
4688-
###### 144. 哪一个选项会导致报错?
4656+
###### 143. 哪一个选项会导致报错?
46894657
46904658
```javascript
46914659
const emojis = ["🎄", "🎅🏼", "🎁", "⭐"];
@@ -4713,7 +4681,7 @@ const emojis = ["🎄", "🎅🏼", "🎁", "⭐"];
47134681
47144682
---
47154683
4716-
###### 145. 我们需要向对象 `person` 添加什么,以致执行 `[...person]` 时获得形如 `["Lydia Hallie", 21]` 的输出?
4684+
###### 144. 我们需要向对象 `person` 添加什么,以致执行 `[...person]` 时获得形如 `["Lydia Hallie", 21]` 的输出?
47174685
47184686
```javascript
47194687
const person = {

0 commit comments

Comments
 (0)