获得徽章 0
赞了这篇沸点
想咨询一下大家,刚毕业的第一份工作干了多久离职的。。。。我先来,一年零一个月 想跑但不敢跑
492
赞了这篇沸点
使用策略模式,如何精简下面的代码?


let tempSortArr=[];
res.data.forEach(item=>{
if(item.strip_line_name.includes('物业费')){
tempSortArr[0]=item
}
if(item.strip_line_name.includes('水电费')){
tempSortArr[1]=item
}
if(item.strip_line_name.includes('工程费')){
tempSortArr[2]=item
}
if(item.strip_line_name.includes('案场费')){
tempSortArr[3]=item
}
if(item.strip_line_name.includes('其他费')){
tempSortArr[4]=item
}
})

console.log(tempSortArr)
展开
7
赞了这篇沸点
还有半个钟,真难受
7
下一页