r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
1
u/roughstonerollin Jun 12 '25 edited Jun 12 '25
> It's not a bug
Hard disagree. Are you telling me it's a feature?
> Of course it can handle integers
No. The "sort" prototype method cannot natively sort integers. You need to pass a comparator function to get it to work (as you point out). Why am I getting downvoted?