let dataA = [
  { name: 'Anne', age: 23, gender: 'female' },
  { name: 'Leila', age: 16, gender: 'female' },
  { name: 'Jay', age: 19, gender: 'male' },
  { name: 'Mark', age: 40, gender: 'male' }
]

let dataB = [
  { name: 'Anne', age: 23, gender: 'female' },
]

let result = dataA.filter(item => {
  return dataB.some(p => item.name === p.name)
})

console.log(result);
Last Updated:
Contributors: pengrengui