Say I have the array
const idArray = ["935", "933", "930"];
And I would like to get the objects that have an id property that matches one of the values in the idArray
const objectsArray= [
{
name: "Kevin",
color: "red",
id: "935"
},
{
name: "Ana",
color: "white",
id: "815"
},
{
name: "Maria",
color: "silver",
id: "035"
},
{
name: "Victor",
color: "red",
id: "935"
},
{
name: "Vanessa",
color: "red",
id: "933"
},
]
So in this case, i would like to return the objects that have the names: Kevin, Vanessa and Victor.