I have two arrays. The first array has only id objects:
arr1 = [
{ id: 1 },
{ id: 2 }
];
and another array has list:
arr2 = [
{ id: 1, name: "kedar" },
{ id: 2, name: "murli" },
{ id: 3, name: "krishnadas" }
];
I need to write arr2 filter function which result as, based on ID available in first array
arr2 = [
{ id: 1, name: "kedar" },
{ id: 2, name: "murli" }
];