this.tableData.map((item,index) =>{
if ( item.discount !== 1 ) {
for (let index = 0; index < discountData.length; indexPP) {
if (item.discountId === discountData[index].id){
flag = true;
}
}
if (!flag) {
item.discount = 2;
console.log("dsfdsf");
}
}
});
to check whether there is any data stored in tabledata in discountdata, it is now written according to id matching, once the first few matches
if (item.discountId === discountData[index].id){
flag = true;
}
after that, it will not continue. How should I change it
?