Report
Coming from a well-structured language like Java, 20 years ago I was so sure JavaScript would fade away, and I would never have to really learn the damn ugly thing.
How come the opposite happen? Even today, I don't really know the answer.
I think there's a couple reasons.
It's been the dominant web language forever at this point. If you wanted to build a web app, or add any sort of interactivity to a webpage, then you were using Javascript. There's some more modern options, but it's hard to go against the inertia that JS has. There's a huge range of libs out there for it, and that saves a lot of dev time over having to roll your own solution. This is especially the case considering a lot of work is just CRUD apps, you're not really doing anything groundbreaking or requiring fine grained control. I
Getting started is super easy and tooling for beginners is quite robust. You can install a functioning web app with a single command that takes care of all your deps and sets up a sane build process.
To give a counterpoint, I'm a huge fan of Clojure and Clojurescript. A problem that I see echoed over and over again is how difficult it is to get a basic app up and running for beginners. This hampers growth, and scares away people that might want to use the language. I'll admit that, for a beginner, JS is a much easier route to get started with.
JS has also gotten significantly better to work with over the years. Things like React have changed how we build apps, and are a huge improvement over the JQuery days. Typescript has also made writing JS much nicer and brings with it a lot of the advantages that typed languages have.
JS is everywhere at this point. I can basically use a the same code base to write a web app, mobile app, server api, or a native desktop app. The ease of being able to port your code across projects, and being able to think in the same language terms, is a big win in a lot of cases.
That's my take on it at least. Javascript is certainly not without its warts, but it does have a lot of positives going for it.
Good analysis.
All those advantages developed (gradually) as javascript remained the only "browser's child".