标签:return time() val new get temp 数组 plist his
1.把数组里的时间参数转化成值
temp.sorttime = new Date(tempList[i].createTime).getTime();
2.对数组里的值进行排序
list.sort(this.compare("sorttime"));
compare方法
compare(property) {
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
return value2 - value1;
};
}
标签:return time() val new get temp 数组 plist his
原文地址:https://www.cnblogs.com/huangbinlooksgood/p/14198262.html