面试题答案
一键面试function compose(...funcs) {
return function (arg) {
return funcs.reduceRight((acc, func) => {
if (typeof acc === 'error') {
return acc;
}
try {
return func(acc);
} catch (error) {
return error;
}
}, arg);
};
}