# compose

代码例子 (opens new window)

const newCompose = (...func) => {
  return function (...rest) {
    return func.reduceRight(function (a, b) {
      return b.apply(null, rest);
    }, rest);
  };
};

1
2
3
4
5
6
7
8