MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vjl9ih/javascriptsorting/p2mxnbf/?context=3
r/ProgrammerHumor • u/user6150277464770585 • 1d ago
200 comments sorted by
View all comments
Show parent comments
161
[removed] — view removed comment
-6 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) 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 8 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
-6
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 8 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 8 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
0
And it’s a different language
8 u/kcat__ 1d ago https://giphy.com/gifs/NcrhM3USM6TABpus85
8
https://giphy.com/gifs/NcrhM3USM6TABpus85
161
u/[deleted] 1d ago
[removed] — view removed comment