I have below sample array which hold nothing but key of object. And I have one object which hold key value pair, so how we can filter the object key based on value present as key in Array?
const arr = ['A', 'B', 'C', 'D', 'E'];
const obj = {
A: 'test1',
B: 'test2',
F: 'test3',
G: 'test4'
}
expected o/p
{
A: 'test1',
B: 'test2',
}