Last active
December 27, 2015 04:59
-
-
Save darkone23/7270937 to your computer and use it in GitHub Desktop.
proxy fn
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 proxy(methodName) { | |
return function(s) { | |
return s[methodName].apply(this, arguments); | |
} | |
} | |
console.log([1,2,3].map(proxy("toString"))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment