Created
March 10, 2017 11:17
-
-
Save adampolar/adae79aebaab0375cb2ffc94d22bf32c to your computer and use it in GitHub Desktop.
"Your scientists were so preoccupied with whether or not they could... they didn’t stop to think if they should."
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 addRecursive(a, compute) { | |
return compute? a : (b, compute2) =>addRecursive(a + b, compute2); | |
} | |
console.log(addRecursive(1)(1)(15)(6)(10)(2, true)); //35 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment