I have an array of object and one array with integer ids.
I want to only have those entries in array of object whose ids are matched with array with has those ids in react jsx.
Ex:
A = [(0)-> id:'123', name:'john', city:'Newyork']
[(1)-> id:'345', name:'martin', city:'Tokyo']
[(2)-> id:'456', name:'lee', city:'Malbonre']
[(3)-> id:'567', name:'roman', city:'Delhi']
[(4)-> id:'789', name:'julie', city:'US']
B = [123, 456,567]
I want the result in such a way that array A should have only
A = [(0)-> id:'123', name:'john', city:'Newyork']
[(1)-> id:'456', name:'lee', city:'Malbonre']
[(2)-> id:'567', name:'roman', city:'Delhi']