SOURCE

let arr1 =[{
    id:1,
    name:"xiaoming"
},{
    id:2,
    name:"b"
},{
    id:3,
    name:"c"
}]

let arr2 =[{
    id:1,
    name:"xiaoming"
},{
    id:2,
    name:"xiaohong"
},{
    id:3,
    name:"xiaokai"
},{
    id:4,
    name:"a"
},{
    id:5,
    name:"b"
},]


function changeArr (source, target)  {
	target.forEach(item => {
		item.isChecked = source.some(item1 => item1.name === item.name);
	});
    return target
};
console.log(changeArr(arr1, arr2))
console 命令行工具 X clear

                    
>
console