These days, if you need huge integers, you can use BigInt, but if you want to use it in an expression that also contains floating point values, then you need to explicitly convert it. Explicit is better than implicit.
The expectation is that sorting an array of integers in place:
[1,3,2,4,5,7,6,8,9,10].sort()
produces an array with the numbers in ascending order (since that's what Ruby/Python do). Not so with JS (try it out).A agree there is a perfectly logical reason for every quirky behavior, but I've been surprised (in a bad way) so many times by JS's counter-intuitive behavior that I now have a mental collection of gotchas where JS deviates from expectation.
JavaScript actually has a formal specification. Ruby and Python have no formal specification. I can tell you (with reference to the specification) exactly what a JavaScript program does. JavaScript may seem wacky on the surface, but actually it's all worked out. Nobody can tell you what a Ruby or Python program does.
And you think JavaScript is the footgun?
"Theory is great in theory, but in practice, practice is better"
JS has many quirks, but I like that the numeric representation is extremely simple and explicit (even compared to Python).
[1,3,2,4,5,7,8,9,10].sort((a,b) => a - b) gives you the behavior one would expect.
I suppose you already know that, though. Agreed there are lots of quirks.
If I understand correctly, Python had a more considered initial design, and had a clean-break overhaul in Python3, allowing it to evolve without accumulating as much cruft and inconsistency. (Python is famous for its philosophy of there should be one—and preferably only one—obvious way to do it.) People use Python by choice: unlike JavaScript where browsers support no other scripting languages, Python won out over its rivals in fair contest.
All things considered, JavaScript isn't that bad. Used correctly it can be elegant and powerful. It has some nasty dark corners, but it generally provides all you need to avoid them, if you know your way around. With modern JIT engines it can even be pretty fast. Its curious use of doubles is just the kind of thing modern JIT engines are able to be smart about, compiling down to use integer operations where possible.