Guest User

Untitled

a guest
Mar 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function curry(fn) {
  2. return (x) => {
  3. return (y) => {
  4. return (z) => {
  5. return fn(x, y, z);
  6. };
  7. };
  8. };
  9. }
  10.  
  11. const sum3 = curry((x, y, z) => {
  12. return x + y + z;
  13. });
  14.  
  15. console.log(sum3(1)(2)(3));
Add Comment
Please, Sign In to add comment