Craft Custom Sorting Rules - Master the Comparator!
Comparators define how two elements should be ordered:
compare(a, b) < 0: a comes before bcompare(a, b) > 0: b comes before acompare(a, b) = 0: equal ordering(a, b) => a.value - b.value for ascending by
value