gsdev99,
<script>
let people = [
{
id: 1,
firstName: 'Alexey',
},
{
id: 2,
firstName: 'Slava'
},
{
id: 3,
firstName: 'Vlad'
},
{
id: 4,
firstName: 'Andrey',
},
{
id: 5,
firstName: 'Mikhail'
},
{
id: 6,
firstName: 'Stepan'
}
]
let arr = [4, 5, 2];
let result = people.filter(p => arr.includes(p.id));
document.write(JSON.stringify(result, null, 4))
</script>