You're viewing a single thread.
All comments
48
comments
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; });
8 0 Replyarr.sort((a, b) => a - b);
37 0 ReplyOne hundred percent how I do it everytime.
2 0 Reply
Stuff like that exists to remind us of the Java in JavaScript
5 0 Reply
48
comments
Scroll to top