📜  javascript compose 函数 - Javascript 代码示例

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

代码示例1
const compose = (...funcs) => args => funcs.reduceRight((arg, fn) => fn(arg), args);

// Or if you like in ES5
function compose(...funcs) 
{
    return function(args)
    {
        return funcs.reduceRight( (arg, fn) => fn(arg), args);
    }
}