Skip to content

Commit 0f316a7

Browse files
committed
feat: 🎸 added infinite currying function
1 parent 9b23bc4 commit 0f316a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Write a sum function: sum(1)(2)(3)(4)
2+
3+
const infiniteCurrying = a => {
4+
return b => {
5+
return b ? infiniteCurrying(a + b) : a
6+
}
7+
}
8+
9+
console.log(infiniteCurrying(1)(2)(3)())

0 commit comments

Comments
 (0)