Created
December 26, 2013 04:05
-
-
Save pc035860/8129655 to your computer and use it in GitHub Desktop.
javascript basic proxy function
This file contains hidden or 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
/** | |
* Context and arguments proxy function | |
* | |
* @param {function} func the function | |
* @param {object} context the context | |
* @param {array} args arguments | |
* @return {function} proxied function | |
*/ | |
function proxy(func, context, args) { | |
return function () { | |
return func.apply(context, args); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment