Created
August 12, 2020 18:36
-
-
Save misterpoloy/b02b3b148b110f4b48e3bb90a284948f to your computer and use it in GitHub Desktop.
Javascript code challenge sum(1)(2)(3)(4)..( n)()
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
// sum(1)(2)(3)(4)..( n)() | |
const sum = (a) => { | |
return (b) => b ? sum(a + b) : a; | |
} | |
console.log(sum(1)(2)(3)(4)()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment