var param = [
{
id: 227901,
goodsName: '苏泊尔石锅',
goodsUnitName: '件',
quantity: 1,
},
{
id: 227900,
goodsName: '宜家小推车',
goodsUnitName: '件',
quantity: 1,
}
]
var a = [
{
id: 228196,
goodsName: '笔筒',
goodsUnitName: '个',
quantity: 1,
}
]
param是原有数组,a为新数组,往param中添加a,如果param中没有a就新增进去,如果有,quantity+1