用reduce求和 const sum = [1,2,3,4,5,6].reduce((v,t)=>{ return v+t; //第一次v=0,t=1 //第二次v= 0+1,t=2 //第三次v=1+2,t=3...... },0)//reduce传入两个值,第一个是个函数,第二个是初始值 map处理字符串然后用reduce const joined = 'this-is-an-example'; joined .split('-') .map( word => {//用map将每个单词的…