79793283

Date: 2025-10-17 17:02:21
Score: 0.5
Natty:
Report link

You could also inline the compare directly if you prefer, see below:

enum State {
  A = "A",
  B = "B",
  C = "C"
}

const prio: [State, number][] = [
  [State.A, 23],
  [State.B, 2],
  [State.C, 5]
];

prio.sort((a, b) => b[1] - a[1]);
console.log(prio);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: colonel