list.forEach((item,index0)=>{
const productName = item.name;
const index = productName.indexOf('(');
if (index == -1) {
return productName;
}
const before = productName.slice(0, index);
const after = productName.slice(index);
item.name=before + '\n' + after;
});
标签:index,slice,const,item,after,js,productName,括号,换行符
From: https://blog.51cto.com/u_12521879/8065036