Sorting array values

Thanks for your reply. No, the " index" value must be a counter from highest to lowest number. 4, 3, 2, 1 and follow the order of the highest to lowest value.

i see.
maybe after the .sort do another .map to add the count ?
myArray.map( (el, index) => el.count = myArray.length - index)

great thanks!!! works

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.