js数组对象以某一对象排序
this.tableData.sort(this.compare('formateDate'))
compare(property){
return function(a,b){
var value1 = a[property];
var value2 = b[property];
return value2 - value1;
}
}
学贵有恒,而行胜于言
this.tableData.sort(this.compare('formateDate'))
compare(property){
return function(a,b){
var value1 = a[property];
var value2 = b[property];
return value2 - value1;
}
}