-
-
Save fmnoise/c3ff7c31410e63a476e810922da6b29a to your computer and use it in GitHub Desktop.
JavaScript: Function.prototype.unbind (for @jugglinmike)
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(origBind) { | |
return function() { | |
var fn = origBind.apply(this, arguments); | |
fn.__origFn__ = this.__origFn__ || this; | |
return fn; | |
}; | |
}(Function.prototype.bind)); | |
Function.prototype.unbind = function() { | |
return this.__origFn__; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment