только "ослах" не будет работать %)
let obj1 = [
{ id: 1, name: "вася" },
{ id: 2, name: "петя" },
{ id: 3, name: "маша" },
{ id: 4, name: "даша" }
]
let obj2 = [
{ id: 1 },
{ id: 2 }
]
let obj2Keys = obj2.map(o2 => o2.id)
let result = obj1.filter(o1 => obj2Keys.includes(o1.id))
console.log(result)