📅  最后修改于: 2022-03-11 15:03:11.859000             🧑  作者: Mango
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);
}
}