r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
-8
u/d0pe-asaurus Jun 12 '25
It would take an O(n) pass to determine if the array consists of numbers only, to decide between a numerical sort and a lexicographic sort.