i have the below array 'predictScore' and able to get the max value using const max = predictScore.reduce((acc, item) => acc = acc > item.prob ? acc : item.prob, 0);
How do i get the max value and associated label and render in a p tag as:
<p>The image uploaded is {max} percentage of {label} </p>
predictScore = [
0: {label: "other", prob: 0.03129873052239418}
1: {label: "dog", prob: 0.033306580036878586}
2: {label: "cat", prob: 0.9353946447372437}
]
So based on the above cat score is 93% so the final output should be The image uploaded is 93% percentage of a cat