- No control over integer type. Everything is a double, except that it sometimes behaves like int for bitwie operation. You lose precision easily and silently. BigNum support is ugly.
- Standard library is one of the worst among all languages, it's inconsistent and missing many basic functions.
- Implicit type casting means you are better off always using === and never relying on truthiness (ie. in "if (...)" better make sure this ... evaluates to true or false, not {}, null, etc, or else you will be surprised by 0).
- We have both exceptions and 2 special marker types (null, undefined). Different libraries will use different methods to signify errors. See Rust for how to do this well.
- Prototype based inheritance sometimes leaks as an abstraction. The only languages I know of that use prototypes are JS and Lua.
The idea that it needs a better standard library is deeply tied to the idea that it should be used as an applications language, but that's actually kind of a recent idea with the advent of runtimes like Node and later Deno and Bun. And all of these do include bigger standard libraries.
I think part of the reason JS has become so popular as both an embedded and application language is that it doesn't have a standard library that needs to be shipped to all embedders/implementations. That's what Java does. And Java lost a lot of ground to JS over the years.
This is in part because JS’s exceptions support is the worst: catch clauses can’t be filtered by type so you have to catch/filter/rethrow, and before ES6 subtyping Error was essentially impossible.
So even if you are fine with exceptions, you don’t want to use them in JS. Even more so before async proper as they obviously did not work correctly through callback chains.
The same applies to the "standard library", which is really just a collection of helper functions under the umbrella of a few top-level built-in objects to keep the core language clean.
I'd rather blame the generations of devs implementing add-ons and syntactic sugar according to the fashion of the day and mimicking their respective favorite language, which adds loads of inconsistencies to the various extensions of the language (often leading to duplicate mechanisms and implementations), depending on when it was done. So there is no common way of communicating with these interfaces and no implicit design philosophy (it may be JFX-style, callback based, a promise, functional, whatever). This is even true for the core language, e.g., arrow-functions breaking the basic convention of arguments always coming as a list.
- Implicit type conversion
- Javascript null handling
- "all numbers are floats"
Other languages have certain ways of dealing with coding tasks that are quirky and weird as well. They are considered bad when they have unexpected side effects -- or cause bugs that are difficult to track down and diagnose.
A common way to fight these issues is to use a linter -- something that runs when the code is built and warns you about lines of code that should most likely be changed or might be error prone.
I used to work on executing JavaScript as part of Google's indexing infrastructure. Some webmasters saw tons of errant URLs with "undefined" and "NaN" in them when Google first started crawling the URLs discovered via JavaScript. It would have been too much work for me to implement full data flow dependency tracking in SpiderMonkey, so I modified the typecast code to perform data flow analysis at the type level. If undefined was ever cast to Number, then all numbers were suspect. If undefined was ever cast to String, then all Strings were suspect. If Number was suspect and NaN was ever cast to String, then all Strings were suspect. We stopped keeping track of generated URLs if Strings became suspect. I put in a few heuristics to cover some common patterns to avoid making things overly suspect, and that seemed to work pretty well. In any case, it would have been better from a dynamic analysis standpoint (and easier on webmasters and their webservers) had JavaScript been more liberal in throwing exceptions instead of trying to limp along after hitting an error.