0
Hello,
I have the following list of objects:
0:
id: 1
firstName: Pedro
lastName: Silva
code: AA
1:
id: 2
firstName: Maria
lastName: Lurdes
code: AB
2:
id: 3
firstName: Joao
lastName: Silva
code: BA
After filling a list with the Ids I want to recover
match = [1,3]
How can I recover objects with Ids "1" and "2 in a new object"?
At the moment I have the following code:
let match = totalObjs.filter((current) => current.id == matches);
Right now if just looking for an ID works but it’s not what I need... The intended objective is the following:
0:
id: 1
firstName: Pedro
lastName: Silva
code: AA
2:
id: 3
firstName: Joao
lastName: Silva
code: BA
I appreciate any help.