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

apply,call,bind #237

Open
alanhe421 opened this issue Jan 4, 2021 · 0 comments
Open

apply,call,bind #237

alanhe421 opened this issue Jan 4, 2021 · 0 comments

Comments

@alanhe421
Copy link
Owner

  1. apply与call,唯一的不同都是参数的不同,apply为参数数组,依次在第一个传入对象参之后,而call是依次在对象参之后,
  2. apply, call都会直接执行对象原型方法
  3. apply与call使用场景主要是借用别的对象的方法及改变this指向
  4. bind与上述两个方法主要不同是bind的返回值是函数,并不会直接执行函数

参考链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant