I have data that looks like this:
{
FL: [{ID: 1, confirmed: true},{ID: 2, confirmed: false}],
TX: [{ID: 3, confirmed: true}],
NY: [{ID: 4, confirmed: false}, {ID: 5, confirmed: true}]
}
And I need to be able to loop over each item in this data find the one
who’s ID === a known ID. I’m not sure the best way to approach this.
The only thing that I can come up with is a for-In loop but Id have to map over the arrays after looping over the object so that doesn’t seem very clean.
Is there any method that is clean for handling iterating over such deeply nested data?