var list = [{ "start": 20, "end": 63, "text": "16" }, { "start": 192, "end": 235, "text": "17" }, { "start": 364, "end": 407, "text": "18" }, { "start": 235, "end": 278, "text": "19" }, { "start": 63, "end": 106, "text": "20" }, { "start": 106, "end": 149, "text": "21" }, { "start": 407, "end": 450, "text": "22" }, { "start": 149, "end": 192, "text": "23" }, { "start": 278, "end": 321, "text": "24" }, { "start": 321, "end": 364, "text": "25" }, { "start": -37, "end": 20, "text": "26" }];
var sortList = list.sort(function (a, b) {
return a.start > b.start
});
排序出来的不对,求解
var sortList = list.sort(function (a, b) { return a.start - b.start; });