Stuff like that exists to remind us of the Java in JavaScript
Comment on I'll just sort it myself
Armand1@lemmy.world 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; });
smik@discuss.tchncs.de 1 year ago
minikieff@lemmy.world 1 year ago
arr.sort((a, b) => a - b);
SpyingEnvy@lemm.ee 1 year ago
One hundred percent how I do it everytime.