检查数组中是否有重复项
function checkRepeatOrSameType(arr) {
return arr.some(function(v, index) {
const idx = arr.findLastIndex(s => (v.id == s.id || (v.type && v.type == s.type)))
return idx !== index;
});
}
function checkRepeatOrSameType(arr) {
return arr.some(function(v, index) {
const idx = arr.findLastIndex(s => (v.id == s.id || (v.type && v.type == s.type)))
return idx !== index;
});
}