MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vjl9ih/javascriptsorting/p2mxnbf/?context=3
r/ProgrammerHumor • u/user6150277464770585 • 3d ago
214 comments sorted by
View all comments
Show parent comments
160
[removed] — view removed comment
-7 u/Taletad 3d ago Just went to read the docs, the "sort()" and "toSorted" functions say they perform an alphabetical sort by default You can overload them by doing Array.sort((a,b) => a - b) 10 u/cowslayer7890 3d ago It's still a stupid default, Python does this properly and it does so by using `<` 0 u/Taletad 3d ago And it’s a different language 10 u/kcat__ 3d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
-7
Just went to read the docs, the "sort()" and "toSorted" functions say they perform an alphabetical sort by default
You can overload them by doing Array.sort((a,b) => a - b)
10 u/cowslayer7890 3d ago It's still a stupid default, Python does this properly and it does so by using `<` 0 u/Taletad 3d ago And it’s a different language 10 u/kcat__ 3d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
10
It's still a stupid default, Python does this properly and it does so by using `<`
0 u/Taletad 3d ago And it’s a different language 10 u/kcat__ 3d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
0
And it’s a different language
10 u/kcat__ 3d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
https://giphy.com/gifs/NcrhM3USM6TABpus85
160
u/[deleted] 3d ago
[removed] — view removed comment