arr1 = [
{active:true, id:1,name: "Business Type"},
{active:true, id:2,name: "report Type"},
{active:true, id:3,name: "Asset Type"},
]
arr2 = [
{active:false, id:1,name: "business type"},
{active:false, id:2,name: "report type"},
{active:false, id:3,name: "asset type"},
{active:false, id:4,name: "business type"},
{active:false, id:5,name: "reimbursement type"}}
]
finally, arr2 = [
{active:true, id:1,name: "business type"},
{active:true, id:2,name: "report type"},
{active:true, id:3,name: "asset type"},
{active:false, id:4,name: "business type"},
{active:false, id:4, Name: "reimbursement Type"}
]
purpose is simply to change the active of arr2 that contains arr1"s thoughts to true, The active that does not contain the arr1 item will not be modified. There is no way of thinking. Several methods have been tried, but none of them are successful.