var arr
=[{"appId":"3","appName":"慧管(西蓝花)"},
{"appId":"4","appName":"慧服务(西蓝花)"}
]
var obj
={"appId":"3","appName":"慧管(西蓝花)"}
if(JSON.stringify(arr
).indexOf(JSON.stringify(obj
)) === -1){
console
.log('不存在')
arr
.push(obj
)
}else{
console
.log('已存在')
}
```javascript
if (my_bookshop_arr
.find(item
=> item
.bid
=== novel_info
.bid
)) {
wx
.showToast({
title
: '书架中已有此书',
icon
: 'success',
duration
: 1000,
mask
: true
})
return;
}
转载请注明原文地址: https://lol.8miu.com/read-21079.html