I have two arrays, my aim is to filter the second array arr2 by the first array arr1, and get only matched values where prid is the same as arr2 id, results should be let filtred = [ {name:'kiwi', color:'red', id:12123},{name:'kiwi', color:'red', id:12123}], how i can ichieve this using filter?
let arr1 = [
{prid:12123},
{prid:12124}
]
let arr2 = [
{name:'kiwi', color:'red', id:12123},
{name:'kiwi2', color:'blue',id:12129},
{name:'kiwi3', color:'green',id:12124}
]