Skip to content

Commit

Permalink
docs: update docs/JavaScript/bind_call_apply.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qiufeihong2018 committed Apr 24, 2024
1 parent 54c8052 commit 94f9d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/JavaScript/ajax.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ xhr.open(method, url, [async][, user][, password])

- `async`:布尔值,表示是否异步执行操作,默认为`true`

- `user`: 可选的用户名用于认证用途;默认为`null
- `user`: 可选的用户名用于认证用途;默认为`null`


- `password`: 可选的密码用于认证用途,默认为`null
- `password`: 可选的密码用于认证用途,默认为`null`



Expand Down
2 changes: 1 addition & 1 deletion docs/JavaScript/bind_call_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn(1,2) // this指向window
从上面可以看到,`apply``call``bind`三者的区别在于:

- 三者都可以改变函数的`this`对象指向
- 三者第一个参数都是`this`要指向的对象,如果如果没有这个参数或参数为`undefined``null`,则默认指向全局`window`
- 三者第一个参数都是`this`要指向的对象,如果没有这个参数或参数为`undefined``null`,则默认指向全局`window`
- 三者都可以传参,但是`apply`是数组,而`call`是参数列表,且`apply``call`是一次性传入参数,而`bind`可以分为多次传入
- `bind `是返回绑定this之后的函数,`apply ``call` 则是立即执行

Expand Down

0 comments on commit 94f9d12

Please sign in to comment.