I have two different sets of data, represented by arrays:
invoices: [
{id: 90, Client: 'Bob', paid: false, total: 900},
{id: 91, Client: 'Sarah', paid: false, total: 400}
]
and:
result: [{km: 200, hours: 20, Person: 'Sarah'}]
The invoices
array is a response retrieved in JSON format via a GET request and may be larger than the result
array. For example, the invoices
array includes Bob while he does not appear in the result
array.
How can I identify the id
of objects whose Client
does not match any entry in the Person
field of the result
array? I attempted to accomplish this using nested for
loops without success.