I have an object like this
const myObject ={
2: {id: 2, name: "Lori Kreiger Jr.", email: "[email protected]", avatar: null, gender: "m"}
3: {id: 3, name: "Kurt Yost", email: "[email protected]", avatar: null, gender: "f"}
4: {id: 4, name: "Norene Hilpert", email: "[email protected]", avatar: null, gender: "m"}
5: {id: 5, name: "Crawford Pouros:, email: "[email protected]", avatar: null, gender: "m"}
}
and an array containing the ids that i will have to filter from this object
const myArray = [2,5];
In the React code i want to loop through myObject filtering it by ids that i have on myArray and passing its values to my component
<ListView id={id} name={name} email={email} ...etc />
How can i achieve this?