about summary refs log blame commit diff stats
path: root/js/curry.js
blob: 1d2266c12bdeb4c969d4d5195a92638c606bdd23 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                        
function curry(fn) {
  const arity = fn.length;

  return function $curry(...args) {
    if (args.length < arity) {
      return $curry.bind(null, ...args);
    }

    return fn.call(null, ...args);
  };
}