📅  最后修改于: 2022-03-11 14:59:27.342000             🧑  作者: Mango
someObjects.sort();
// By object property value
someObjects.sort((a, b) => a.someProperty.compareTo(b.someProperty));
// To reverse sort, just swab a and b
someObjects.sort((a, b) => b.someProperty.compareTo(a.someProperty));