📜  颤振排序列表 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:27.342000             🧑  作者: Mango

代码示例3
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));