Looking to filter one array with another, where values in the first array should match 'id' in the second array for filtering.
The arrays in question are:
const array1 = [a, b, c, d]
The array to be filtered based on matching 'id' values from array1 is:
const array2 = [
{
id: b
title: title1
},
{
id: d
title: title2
},
{
id: f
title: title3
}
]