Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
willtim
· 6y ago · 0 comments
Most would expect 10 to parse as an integer. To specify a string, most would be happy with putting quotes around it. So I don't think dynamic types fully explains the bizarre behaviour.
Comments
[–]
matthuggins
6y ago
What if you tried to sort an array of objects or functions?
[–]
willtim
OP
6y ago
If one doesn't specify a comparator and there is no obvious/sensible default, then an error would be perfectly reasonable.