代码实现:
$.each(goodsArray, function(index){
if(goods.barCode == goodsArray[index].barCode){
goodsArray[index].count++;
boo = true;
return;
}
});
本文介绍了一种使用jQuery的$.each方法遍历商品数组并根据条形码进行匹配和计数的代码实现。当找到相同条形码的商品时,会增加其数量计数。
代码实现:
$.each(goodsArray, function(index){
if(goods.barCode == goodsArray[index].barCode){
goodsArray[index].count++;
boo = true;
return;
}
});
1227

被折叠的 条评论
为什么被折叠?