From the given array of objects how to filter the expected output
let a = [{name:'Hari',age:2},{name:'Chana',age:4},{name:'Like',age:5}]
let b = [{name:'Chana',age:14},{name:'Like',age:15}];
I tried this but not working;
let c =a.filter(elm => b.find(el => el.name === elm.name));
expected output is [{name:'Hari',age:2}]
!b.find(...). But I wouldn't use.find()here as you're after a boolean, instead, you could use!b.some(...)