225 B
225 B
importance: 4
Sum with closures
Write function sum
that works like this: sum(a)(b) = a+b
.
Yes, exactly this way, using double parentheses (not a mistype).
For instance:
sum(1)(2) = 3
sum(5)(-1) = 4