红颜莎娜
'/a/b/c/d'.match(/\/\w+/g).reduce((s,i,index)=>{ if(index>0) s.push(`${s[index-1]}${i}`); else s.push(`${i}`); return s;
},[]);再简化'/a/b/c/d'.match(/\/\w+/g).reduce((s,i,index)=>{
s.push(`${s[index-1]||''}${i}`); return s;
},[]);再牺牲可读性'/a/b/c/d'.match(/\/\w+/g)
.reduce((s,i,index)=>(s.push(`${s[index-1]||''}${i}`),s), []);