compose函数
将函数扁平化处理
1 | function fn1(x){ |
但是这么写太麻烦了 所以可以简化为这样 使用reduce 函数
1 | function compose(...funs){ |
将函数扁平化处理
1 | function fn1(x){ |
但是这么写太麻烦了 所以可以简化为这样 使用reduce 函数
1 | function compose(...funs){ |
本文标题:js-compose函数
文章作者:mogugit
发布时间:2020-06-02, 13:19:43
最后更新:2025-03-24, 10:47:54
原始链接:https://mogugit.github.io/2020/06/02/js-compose%E5%87%BD%E6%95%B0/
许可协议: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。