Skip to content

Commit e960370

Browse files
fix: typo (#1156)
* fix: typo * fix: translation mistake * fix: translation mistake * Update 1-js/06-advanced-functions/10-bind/article.md Co-authored-by: Songhn <songhn233@gmail.com> --------- Co-authored-by: Songhn <songhn233@gmail.com>
1 parent 12e0621 commit e960370

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

1-js/05-data-types/12-json/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ alert( JSON.stringify(meetup, *!*['title', 'participants', 'place', 'name', 'num
246246

247247
该函数会为每个 `(key,value)` 对调用并返回“已替换”的值,该值将替换原有的值。如果值被跳过了,则为 `undefined`
248248

249-
在我们的例子中,我们可以为 `occupiedBy` 以外的所有内容按原样返回 `value`为了 `occupiedBy`,下面的代码返回 `undefined`
249+
在我们的例子中,我们可以为 `occupiedBy` 以外的所有内容按原样返回 `value`对于 `occupiedBy`,下面的代码返回 `undefined`
250250

251251
```js run
252252
let room = {

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ alert( triple(5) ); // = mul(3, 5) = 15
275275
276276
## 在没有上下文情况下的 partial
277277
278-
当我们想绑定一些参数(arguments),但是这里没有上下文 `this`,应该怎么办?例如,对于一个对象方法。
278+
当我们想绑定一些参数(arguments),但是不想绑定上下文 `this`,应该怎么办?例如,对于一个对象方法。
279279
280280
原生的 `bind` 不允许这种情况。我们不可以省略上下文直接跳到参数(arguments)。
281281
@@ -319,7 +319,7 @@ user.sayNow("Hello");
319319
320320
## 总结
321321
322-
方法 `func.bind(context, ...args)` 返回函数 `func` 的“绑定的(bound)变体”,它绑定了上下文 `this` 和第一个参数(如果给定了)
322+
方法 `func.bind(context, ...args)` 返回函数 `func` 的“绑定的(bound)变体”,它绑定了上下文 `this` 和 `...args` 参数
323323
324324
通常我们应用 `bind` 来绑定对象方法的 `this`,这样我们就可以把它们传递到其他地方使用。例如,传递给 `setTimeout`。
325325

0 commit comments

Comments
 (0)