goldEli / Front-End-Training

Front End Training
2 stars 5 forks source link

组合函数的理解 #79

Open FireDragonZL opened 4 years ago

FireDragonZL commented 4 years ago

请回答:

FireDragonZL commented 4 years ago

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"]