Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do not think it's intuitive. The reason it works for mixed arrays is that the minus operator coerce operands to numbers. However if the strings fail to convert to a numeric value, the output is arguably even less sensible. I'd imagine that's why it is.

It may have been thought that js would be more likely to be dealing with strings arrays.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: