arr1 = [{active:true, id=1,name: 业务类型},{active:true, id=2,name: 报表类型},{active:true, id=3,name: 资产类型},]arr2 = [{active:false, id=1,name: 业务类型},{active:false, id=2,name: 报表类型},{active:false, id=3,name: 资产类型},{active:false, id=4,name: 商业类型},{active:false, id=5,name: 报销类型}]最终要的是arr2 = [{active:true, id=1,name: 业务类型},{active:true, id=2,name: 报表类型},{active:true, id=3,name: 资产类型},{active:false, id=4,name: 商业类型},{active:false, id=4,name: 报销类型}]目的只要把arr2的有包含arr1想的active改成true,没有包含arr1项的active就不修改,没有思路 试了用几种方法,都没成功
添加回答
举报
0/150
提交
取消