Created
December 31, 2020 17:41
-
-
Save rajatjain-21/15791dc9969bf7da40c524568b0ec1d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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