What's the best way to return data from an array if the index matches another array?
I have a collection of users:
Collection [Map] {
'531592097837613058' => {}
'460281004972572672' => {}
}
And I have array with allowed IDs:
const allowedRoles = ['523928765865394211'];
What I'd like to achieve, is return collection's object where the index matches some one of the indexs in AllowedRoles. In theory, it's quite simple, but I'm misunderstanding collection methods.