Skip to content

Instantly share code, notes, and snippets.

@rajatjain-21
Created December 31, 2020 17:41
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 rajatjain-21/15791dc9969bf7da40c524568b0ec1d8 to your computer and use it in GitHub Desktop.
Save rajatjain-21/15791dc9969bf7da40c524568b0ec1d8 to your computer and use it in GitHub Desktop.
Function.prototype.bind = function(...args) {
let obj = this;
let params = args.slice(1);
return function(...args2) {
obj.apply(args[0], [...params, ...args2]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment