Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

test #188

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion JS/JS-ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ Object.setPrototypeOf(MyData.prototype, Date.prototype)

首先说下前两者的区别。

`call` 和 `apply` 都是为了解决改变 `this` 的指向。作用都是相同的,只是传参的方式不同。
`call` 和 `apply` 都是为了解决改变 `this` 的指向。作用都是相同的,只是传参的方式不同。通俗来讲就是,a有xx方法,b没有。b可以问a借!

除了第一个参数外,`call` 可以接收一个参数列表,`apply` 只接受一个参数数组。

Expand Down