Forum Discussion
bojanvelevski
4 years agoValued Contributor
Hey @vaidyarm,
Use the following expression in a mapper to get the expected result:
$array.map((x,index)=>{"value":x,"index":index}).filter(x=>x.value==($array.sort((a,b)=>b-a)[0]))
This will produce an array of objects, which will contain the max value, and It’s corresponding index.
Input:
Output: