what is the most idiomatic way of going through an array of json and setting a field on the object with the max on a particular field - and removing that field from everyone else
d
Dominaezzz
06/03/2020, 8:53 PM
maxBy
and
forEach
a
asad.awadia
06/04/2020, 12:17 AM
is it possible to do it in one pass?
d
Derek Peirce
06/06/2020, 8:16 PM
maxBy
does perform a check on each item, so you could perform the removal within that check.