Skip to content

2632. Curry 👍

1
2
3
4
5
6
7
function curry(fn: Function): Function {
  return function curried(...args: any[]): any {
    return args.length >= fn.length
      ? fn.apply(this, args)
      : curried.bind(this, ...args);
  };
}