1. function compose(...fn) {
    2. return (...args) => fn
    3. .reverse()
    4. .slice(1)
    5. .reduce((acc, cur) => cur(acc), fn[0](...args))
    6. }
    7. const add10 = (x) => x + 10;
    8. const mul10 = (x) => x * 10;
    9. const add100 = (x) => x + 100;
    10. // (10 + 100) * 10 + 10 = 1110
    11. // 从后往前操作
    12. console.log(compose(add10, mul10, add100)(10));