r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
6
u/TorbenKoehn Jun 12 '25
Why, if there is a logical default? Since the array item types can be mixed and any value in JS can be casted to a string, but not any value can be casted to a number, it makes sense to compare by string value naturally
When has this ever been an actual problem that went to prod? Except for extremely untested implementations maybe?