How can I sum values in an array of objects based on a specific condition?
[{amount:100, prefix:'a'},{amount:50, prefix:'b'},{amount:70, prefix:'a'},{amount:100, prefix:'b'}]
Is there a method to map and calculate the sums separately for 'a' and 'b' prefixes, resulting in totals of 170 for 'a' and 150 for 'b'?