js正常语法
//存在唯一索引的对象数组,-1表示不存在
let i = checkedGoodsAttributes.findIndex(function(item){return item.goods_attribute_uuid == checkedAttr.goods_attribute_uuid})
if (i != -1){
checkedGoodsAttributes.splice(i,1)
}
// 数值类数组
let j = checkedCartUuids.indexOf(uuid);
if (j != -1){
checkedCartUuids.splice(j, 1)
}
ES6箭头语法
let i = checkedGoodsAttributes.findIndex(item=>item.goods_attribute_uuid == checkedAttr.goods_attribute_uuid)
if (i != -1){
checkedGoodsAttributes.splice(i,1)
}
let j = checkedCartUuids.indexOf(uuid);
if (j != -1){
checkedCartUuids.splice(j, 1)
}