Created
April 17, 2014 16:51
-
-
Save zapthedingbat/10997535 to your computer and use it in GitHub Desktop.
Creates a function that executes with the given context and pushes the original context to the first argument of the function.
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
// Creates a function that executes with the given context and pushes the original context to the first argument of the function. | |
unshiftContext: function(func, thisArg) { | |
return function() { | |
var args = Array.prototype.slice.call(arguments); | |
args.unshift(this); | |
func.apply(thisArg, args); | |
}; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment