I have a collection of peaks in the following format:
peaks =
0: {intervalId: 7, time: 1520290800000, value: 54.95125000000001}
1: {intervalId: 7, time: 1520377200000, value: 49.01083333333333}
and so on.
I am looking to determine the peak with the highest value. I attempted to achieve this using the following code:
this.loadPeak = peaks.map(a => Math.max(a.value));
However, instead of getting the maximum value along with the intervalId and time, I only received an array of values from all peaks without obtaining the maximum value itself.
**I appreciate all the solutions provided. Although I cannot accept them all, they were all helpful. Thank you!**