📅  最后修改于: 2022-03-11 15:04:28.779000             🧑  作者: Mango
var compareDate = (t1: Interface, t2: Interface) => {
var t1Date = new Date(t1.createDate);
var t2Date = new Date(t2.createDate);
return t1Date > t2Date ? -1 : 1;
};
arr = [...objectarr].sort(compareDate);