How do you find the 10 indexes of a javascript array that have the highest numeric values?

I am counting the frequency of numbers between 0 and 256 found in a sequence using a javascript array.

If I see the number 74 pop up I am storing it in the 74th index value (i.e. mysequence[74] = mysequence[74] + 1)

I can see the results tallied and its easy when scanning it visually to see that certain numbers (for example 65) has appeared much more often than others. I want to find the 10 numbers that appear most often.

I am concerned a simple sort will not retain the index value which is what I am using to track which number is associated with the counted frequency.

The only thought that comes to mind would be a brute force approach. Creating a function to look through all values one by one keeping the highest and ignoring all indexes that are part of an ignore list. Then running that function 10 times, each subsequent time passing the values of the indexes that have been assigned the top values.

Is there a way to get the numeric keys associated with the top 10 values without resorting to the approach above? (i.e. maybe converting my data to a different format and some fancy map sorting functions?)