Why do people use JavaScript? Because it's a great language or because it's the only one ready-to-use in any web browser?
Note that several of these arguments also apply to PHP, another _de facto_ application-specific (web server) language, that I think is mostly used because of technical debt.
This article is about JavaScript for web browsers, not NodeJS or TypeScript.
* no native cryptographic primitives if you aren't using HTTPS and satisfying other strange "security" requirements (you often end up inefficiently implementing SHA2 or AES in JS, while the browser natively uses OpenSSL)
Having a decent standard library would reduce the use of weird hacks hence the number of bugs, and the use of libraries hence the traffic and webpage size and loading time.
*`(-1)%2 == -1` while most of the time the convention is to give the least positive congruent.
* Naming is incoherent. `XMLHttpRequest` is an example mixing all-caps and first-letter-cap conventions for initialisms. It should have been either `XmlHttpRequest` or `XMLHTTPRequest`.
* Is an array really an array, or an object with _some_ of the array's properties? Lua has the same problem.
```js
var foo = [];
foo["bar"] = 42;
console.log(foo["bar"]); // foo["bar"] exists.
console.log(foo.length); // 0
```
*`document.getElementsByClassName` does not return an array: its return type supports indexing but not for/in loops.
However, plain HTML/CSS should *always* be prefered, for performance, compatibility and accessibility. Form inputs crafted with tons of CSS and JS are often unresponsive, not accessible to screen readers, incompatible with native features, inefficient. It is even worse for pages rendered in a canvas.
Please use the wonderful possibilities offered by HTML5 and CSS3, and follow the accessibility recommendations by the [W3C](https://www.w3.org/WAI/) and [Mozilla](https://developer.mozilla.org/en-US/docs/Web).