compose实现函数扁平化

104 阅读1分钟

** 实现函数嵌套执行**

原理: 利用# Array.prototype.reduce() 和 # Array.prototype.reduceRight() 实现函数由左到右嵌套 还是 由右向左嵌套

代码参考如下:

image.png