closure task

This commit is contained in:
Ilya Kantor 2019-12-29 00:33:46 +03:00
parent 6be43b16a9
commit c2a9c2da58
4 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,17 @@
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:
```js
sum(1)(2) = 3
sum(5)(-1) = 4
```