Curry a function in JavaScript
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.jepso-ci.json
Readme.md
component.json
index.js

Readme.md

jepso-ci status

curry

Curry a function in JavaScript

Installation

$ component install ForbesLindesay/curry

API

var curry = require('curry');

var sumFour = curry(function (a, b, c, d) {
  return a + b + c + d;
});

sumFour(5)(5)(5)(5);// => 20
sumFour(5, 5)(5, 5);// => 20
sumFour(5, 5, 5, 5);// => 20
sumFour(5)(5, 5, 5);// => 20
sumFour(5, 5, 5)(5);// => 20

License

MIT

viewcount