I'll just sort it myself
I'll just sort it myself
I'll just sort it myself
You're viewing a single thread.
As annoying as this is, you are meant to use a comparer.
undefined
mapped.sort((a, b) => { if (a.value > b.value) { return 1; } if (a.value < b.value) { return -1; } return 0; });
undefined
arr.sort((a, b) => a - b);
One hundred percent how I do it everytime.
Stuff like that exists to remind us of the Java in JavaScript