4 ms·
> Is there really such a need? Yes. Because programs, unless they deal with machine learning, statistics or other intentional approximations, deal with _stri
by rdtsc 13y ago
> Is there really such a need?
Yes.
Because programs, unless they deal with machine learning, statistics or other intentional approximations, deal with _strict_ things.
If you put $0.5 in an account you don't expect to find $0.2 there when you read it back or find "Hi Jim" there. You expect to find $0.5, when you seek to byte offset 19553 in the file you expect to read starting with byte 19553 on next read not "something in the vicinity of byte 19553".
[] + [] should not be '', never, it never makes sense, it is not brilliant it is rather profoundly stupid.
Ok, language is broken, we established it, let's take a look at the library functions. At least there cooler heads prevailed:
$ node
> [1,10,9,-3,-4].sort()
[ -3, -4, 1, 10, 9 ]
Nope, they didn't.
- lifthrasiir 13y agoMy favorite library strangeness is: > [1, 4, 9].map(sqrt) [1, 2, 3] > ['1', '2', '3'].map(parseInt) [1, NaN, NaN] cf. http://stackoverflow.com/questions/262427/javascript-arraymap-and-parseint http://stackoverflow.com/questions/262427/javascript-arrayma...