条件:arrA,arrB,通过对比修改arrB中的字段值
var sSrr = []; var arrA = [ {name:'这是一',Id:1}, {name:'这是二',Id:2}, {name:'这是三',Id:3}, {name:'这是一',Id:1}, {name:'这是二',Id:2} ] var arrB = [ {name:'这是二',Id:2}, {name:'这是三',Id:3} ] arrA.forEach(i=>{ sSrr.push(i.name+i.Id) }) arrB.forEach(r=>{ if(sSrr.indexOf(r.name+r.Id)>-1){ r.disabled = true }else{ r.disabled = false } })