minus-squareArmand1@lemmy.worldtoProgrammer Humor@programming.dev•I'll just sort it myselflinkfedilinkarrow-up8arrow-down4·1 year agoAs 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; }); linkfedilink
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; });