I currently have a JSON file with an array of hashes and would like to be able to return an array of hashes for each matching key "Club" that contains the highest "Decimal" value (using javascript in my Angular app).
[
{"Bookmaker": "First", "Club": "Man City", "Decimal": 3.65},
{"Bookmaker": "First", "Club": "Man Utd", "Decimal": 4.5},
{"Bookmaker": "First", "Club": "Chelsea", "Decimal": 6.8}
{"Bookmaker": "Second", "Club": "Man City", "Decimal": 3.5},
{"Bookmaker": "Second", "Club": "Man Utd", "Decimal": 4},
{"Bookmaker": "Second", "Club": "Chelsea", "Decimal": 7}
]
In this example the returned array would be like so:
[
{"Bookmaker": "First", "Club": "Man City", "Decimal": 3.65},
{"Bookmaker": "First", "Club": "Man Utd", "Decimal": 4.5},
{"Bookmaker": "Second", "Club": "Chelsea", "Decimal": 7}
]
Returning the hashes with the highest "Decimal" value for each "Club".