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

5. 实现call、bind、apply方法 #5

Open
senfish opened this issue Jul 20, 2021 · 1 comment
Open

5. 实现call、bind、apply方法 #5

senfish opened this issue Jul 20, 2021 · 1 comment

Comments

@senfish
Copy link
Owner

senfish commented Jul 20, 2021

No description provided.

@senfish
Copy link
Owner Author

senfish commented Jul 23, 2021

apply方法

Function.prototype.apply = function (context, argu) {
  key = Symbol('key');
  context[key] = this;
  let res = context[key](...argu);
  delete context[key];
  return res;
}

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