Open FireDragonZL opened 4 years ago
function compose(...funcs) {
return funcs.reduce((a, b) => (...args) => a(b(...args)))
}
function str2UpperCase(str){ return str.toUpperCase(); }
function subThreeChar(str){ return str.substring(0,3); }
function strSplit2Array(str){ return str.split('') }
const res03 = compose( strSplit2Array, subThreeChar, str2UpperCase, )("sdhsdshk");
console.log(res03) //["S", "D", "H"]
请回答: