# ES6 Curry Function
```js
const curry = (fn, ...cache) => (...args) => {
const all = cache.concat(args);
return all.length >= fn.length ? fn(...all) : curry(fn, ...all);
};
```
## Example
Create a function like so:
```js
const add = curry((a, b, c) => a + b + c);
```
Use it as follows:
```js
add(1);
// => function
add(1, 2);
// => function
add(1, 2, 3);
// => 6
add(1)(2)(3);
// => 6
```