【发布时间】:2021-02-03 14:23:53
【问题描述】:
在 JavaScript 中按降序对列表记录进行排序
var number; //here we are getting dynamic number from API
var test; //here we are getting dynamic text from API
for (var i; i <= accList.length; i++) {
var odlist = 'you have :' + test + number +
dataList.push(odlist);
}
当前输出:
1.you have : total 4 accounts of 10
2.you have : total 11 account accounts of 23
3.you have : total 0 accounts of 100
4. you have : total 2 accounts of 6
现在我想按降序对上面的列表进行排序,以查找如下输出:
1.you have : total 0 accounts of 100
2.you have : total 11 account accounts of 23
3.you have : total 4 accounts of 10
4.you have : total 2 accounts of 6
【问题讨论】:
标签: javascript jquery sorting for-loop arraylist