We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
call
Function.prototype.myCall = function(context = window, ...args) { let fn = this; let key = Symbol("key"); context[key] = fn; const res = context[key](...args); delete context[key]; return res; };
apply
Function.prototype.myApply = function(context = window, args) { let fn = this; let key = Symbol("key"); context[key] = fn; const res = context[key](...args); delete context[key]; return res; };
bind
Function.prototype.myBind = function(context = window, ...args) { const fn = this; const bindFn = function() { return fn.apply( this instanceof bindFn ? this : context, args.concat(Array.prototype.slice.call(arguments)) ); }; bindFn.prototype = Object.create(this.prototype); return bindFn; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
call
apply
bind
The text was updated successfully, but these errors were encountered: