Created
July 2, 2015 03:07
-
-
Save Dafrok/c29df0eb743fe032cfca to your computer and use it in GitHub Desktop.
curry
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 add(n){ | |
| var _callee=arguments.callee | |
| if(typeof(n)=='number'){ | |
| return function(m){ | |
| if(typeof(m)=='number'){return _callee(n+m)} | |
| else{return n} | |
| } | |
| } | |
| } | |
| console.log(add(1)(2)(3)(4)(5)()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment