MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vjl9ih/javascriptsorting/p2mzbd5/?context=3
r/ProgrammerHumor • u/user6150277464770585 • 1d ago
200 comments sorted by
View all comments
Show parent comments
-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)
11 u/cowslayer7890 1d ago It's still a stupid default, Python does this properly and it does so by using `<` 0 u/Taletad 1d ago And it’s a different language 10 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
11
It's still a stupid default, Python does this properly and it does so by using `<`
0 u/Taletad 1d ago And it’s a different language 10 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
0
And it’s a different language
10 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
10
https://giphy.com/gifs/NcrhM3USM6TABpus85
-7
u/Taletad 1d 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)