> [1,10,5,-15,-2,4].sort();
[-15,-2,1,10,4,5]
And yes saying "oh but it is because it has weak types" doesn't excuse it, it is broken and that's that. Naming the brokeness with a label or showing why historically it is there, doesn't fix it.On the other hand they do have nice closure support, I do like some of that. But in large, the language makes me angry every time I have to use it.
Someone mentioned Dart, I am hopeful for that. But who knows how long till dartvm is embedded in Chrome. For now dart.js and source maps might help.
There is a bit more palatable Coffeescript. But it only puts some band-aids over JS's brokenness.
Also agree with callback hell. It is funny people extol is at the next big thing -- whoo, asynchronous calls! You can callback in your callback while you callback. No, no, no. That is a horrible way to handle large concurrency problems! (Good for quick one page examples though!). Async and friends help. But why the heck do I need to stick a callback in the middle of my logic if all I need to do is make a request to the database or another GET request?
The only sane way I know how to best handle concurrency is using a language with support of goroutines/isolates/tasks or even threads and queues. Even deferreds are just sugar on top of callbacks. We all know how Python's Twisted has taken over the world, right? Oh wait, it hasn't. Calling them Futures or Tulips or whatever doesn't fix the underlying problem.
> I can understand that some people wanted to escape the MRI infrastructure by going Node, because - you know - learning Japanese is hard.
Granted node is fast. (And according to its author scales linearly across CPU cores, sorry couldn't resist the mandatory jab at that). Ok it doesn't really scale across cores and it will block everything if you do a for loop in the middle of your logic. But it is really fast, amazingly so. And that is like crack. It gets people hooked.
EDIT: JS has weak types not just dynamic, one can have dynamic and strong types for example, like Python ( https://en.wikipedia.org/wiki/Weak_typing ). Thanks makslinn.