I have a problem with filtering an array with nested objects.
[{
"firstName": "Kevin",
"lastName": "Smith",
"expenses": {
"drink1": 25,
"drink2": 20
}
},
{
"firstName": "John",
"lastName": "Rambo",
"expenses": {
"coffe": 10,
"cake": 20
}
}
]
I want to get the objects where the sum of all expenses is > 35. How to get inside expenses
? Or maybe filter is not a proper way here.