Last active
December 26, 2015 00:29
-
-
Save kgarfinkel/7064111 to your computer and use it in GitHub Desktop.
Javascript's 'bind' re-implemented.
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
var bind = function(fn, context) { | |
var args = Array.prototype.slice.call(arguments, 2); | |
return function() { | |
return fn.apply(context, args.concat(Array.prototype.slice.call(arguments))); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mine :)