• Armand1@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    4
    ·
    1 year ago

    As annoying as this is, you are meant to use a comparer.

    mapped.sort((a, b) => {
      if (a.value > b.value) {
        return 1;
      }
      if (a.value < b.value) {
        return -1;
      }
      return 0;
    });