Skip to content

Instantly share code, notes, and snippets.

@bjangid20
Created June 16, 2021 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjangid20/1de9e3e6ca40d2eb4fab17c09313e24a to your computer and use it in GitHub Desktop.
Save bjangid20/1de9e3e6ca40d2eb4fab17c09313e24a to your computer and use it in GitHub Desktop.
Implement bind in js
Function.prototype.mybind = function (context, ...args1) {
let fn = this;
return function (...arg2) {
fn.apply(context, [...args1, ...arg2])
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment