一、特征
函数式一等公民
强调将计算过程分解成可以复用的函数
纯函数、没有副作用
二、compose
function compose(...funcs) {if(funcs.length === 0){return (args)=> args; }if(funcs.length === 1){return funcs[0]; }return funcs.reduce((a,b)=>(...args)=>b(a(...args)));}
function f1(x){ return x*2 }
function f2(x){ return x+2 }
function f3(x){ return Math.pow(x,2) }
const result = compose(f1, f2, f3);
console.log(result(1)); //16
三、柯里化
https://www.cnblogs.com/shangyueyue/p/10609943.html