Skip to content

Commit c6235db

Browse files
committed
Merge pull request loverajoel#349 from hingsir/patch-8
typo fix
2 parents 518c3e8 + 791a5bc commit c6235db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/zh_CN/2016-04-05-return-values-with-the-new-operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ myThing.one // 1
2727
myThing.two // 2
2828
````
2929

30-
__提示__: `this`指向`new`产生的新对象。否则如果`Thing()`不适用`new`调用, __将不会生成新对象__, 而且`this` 将会指向全局对象,也就是`window`。这意味着:
30+
__提示__: `this`指向`new`产生的新对象。否则如果`Thing()`不是用`new`调用, __将不会生成新对象__, 而且`this` 将会指向全局对象,也就是`window`。这意味着:
3131

3232
1. 你突然有两个全局变量`one``two`
3333
2. `myThing`现在为`undefined`,因为`Thing()`中没有返回任何东西。
@@ -85,4 +85,4 @@ console.log(myThing);
8585

8686
__我们了解到:__ 当你使用`new`关键字调用一个函数的时候,你可以使用`this`关键字给其设置参数(但这些你应该已经知道了)。使用`new`关键字调用一个返回原始变量的函数将不会返回你指定的值,而是返回函数的实例`this`(你指定参数的那个对象,像 `this.one = 1;`).
8787

88-
然而,返回一个非原始变量像`object``array``function`将会覆盖`this`实例,并返回那个费原始变量,有效的破坏了你分配给`this`的所有工作。
88+
然而,返回一个非原始变量像`object``array``function`将会覆盖`this`实例,并返回那个非原始变量,有效的破坏了你分配给`this`的所有工作。

0 commit comments

Comments
 (0)