主要是这句,把计数相同的放到一个数组里按照原index排序
currentMaxNameArr.sort((item1, item2) => item1.index - item2.index);