I have an array of dictionaries and I am trying to fetch the dictionary with the highest value from the array.
const array = [{"value": 1}, {"value": 3}, {"value": 2}]
I want to fetch {"value": 3}
since its "value" key has the highest value.
What is the most elegant way of achieving this in TypeScript? I thought about sorting the array first by the value key but even that seems to be a pain.