An array of objects is returned to me. How to return an array of objects where only the unique groups with the maximum value will remain?

[
{"score": 99, "group":"1"},
{"score": 90, "group":"2"},
{"score":"10", "group":"1"},
{"score":"10",      "group":"2"},
]
 

I work with TypeOrm now and want to filter data.

Expected array:

[
{"score": 99,      "group":"1"},
{"score": 90,     "group":"2"},
]