📜  什么是功能组合 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:04.541000             🧑  作者: Mango

代码示例1
const myResult = f1(  f2(data)  );                      // composition: pass the output DATA of one function to the input of another ... like pipes.
function add(a){return  function(b){return a + b}  }     // functional composition
add(2)(3) //-> 5