JavaScript:用forEach遍历数组

let stock = itemStockData[0].StockQty;
                                that.goodsList.forEach((item,index)=>{
                                    if(item.ItemNo==goods.ItemNo){
                                        that.goodsList[index].store=stock;
                                    }
                                })

你可能感兴趣的:(js)