- 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;
- });