Skip to content

Commit 5d533c0

Browse files
committed
typo
1 parent 2534ec4 commit 5d533c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README-zh_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,7 @@ setTimeout(() => {
25882588

25892589
#### 答案: B
25902590

2591-
`this`关键字的指向取决于使用它的位置。 在**函数**中,比如`getStatus``this`指向的是调用它的对象,上述例子中`data`对象调用了`getStatus`,因此`this`指向的就是`data`对象。 当我们打印`this.status`时,`data`对象的`status`属性被打印,即``🥑“`。
2591+
`this`关键字的指向取决于使用它的位置。 在**函数**中,比如`getStatus``this`指向的是调用它的对象,上述例子中`data`对象调用了`getStatus`,因此`this`指向的就是`data`对象。 当我们打印`this.status`时,`data`对象的`status`属性被打印,即`"🥑"`
25922592

25932593
使用`call`方法,可以更改`this`指向的对象。`data.getStatus.call(this)`是将`this`的指向由`data`对象更改为全局对象。在全局对象上,有一个名为`status`的变量,其值为`”😎“`。 因此打印`this.status`时,会打印`“😎”`
25942594
</p>

0 commit comments

Comments
 (0)