I have the following array of objects and I want to find the highest weight of any person in any year (the weight is enough, I don't need the corresponding year or name).
Thanks in advance :)
var arr = [
{
'name': 'Bob',
'weights': [
{
'weight': 90,
'year': 2018
},
{
'weight': 85,
'year': 2017
},
// etc.
]
},
'name': 'Charlie',
'weights': [
{
'weight': 65,
'year': 2018
},
{
'weight': 60,
'year': 2017
},
// etc.
]
},
// etc.
]