Created
April 18, 2015 16:08
-
-
Save nkaretnikov/4ad7952f220989761d59 to your computer and use it in GitHub Desktop.
Apply
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
function transparentWrapping(f) { | |
return function() { | |
return f.apply(null, arguments); | |
}; | |
} | |
function add3(x, y, z) { | |
return x + y + z; | |
} | |
console.log(transparentWrapping(add3)(1, 2, 3)); | |
// 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment