by CJefferson · 2y ago · 0 comments
Is there any magic quick way of doing this in modern JavaScript, or do I have to keep cutting+pasting a comparator I wrote everywhere?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[ [1,23], [11,1], [11,44], [22,4] ]
I'd consider this list "sorted", as the inner lists are sorted lexicographically. Except, if I gave this list to Javascript and asked it to sort it, it would cast each of the inner lists to strings, which (for example) leads to [11,11] < [1,1], as "[11,11]" < "[1,1]"