Created
August 29, 2015 14:51
-
-
Save darklight721/7544d835a00d11f545b6 to your computer and use it in GitHub Desktop.
My answer to this: https://github.com/frantic/currying
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) { | |
let t = n.reduce((a, b) => a + b); | |
let a = add.bind(0, t); | |
a.valueOf = () => t; | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment