r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
16
u/Lithl Jun 12 '25
Even ignoring the fact that you're suggesting adding an unnecessary O(n) computation to the sort function, the "nearest supertype" of almost any pair of values of different types is going to be Object.
What is the logical ordering of two arbitrary Objects?