It works great for me and my team and we are hugely productive using it. That why. It works and we deliver a lot of value.
Python, for example, got a lot better a lot faster than JS did.
When a language is successful, people start to bolt on extra bits of syntax and features (async, prototypes/classes, lambdas, etc). Eventually it is no longer simple, and the learning curve gets steeper for new users.
Someone comes up with a new simple yet flexible language, all the new users start with that instead, and the cycle repeats.
BASIC/visual basic/VB.net went through that cycle in the 90's. C then C++ went through that in the 2010's. Python/Javascript is going through that now. Go is about to go through the same.
Great things require tremendous effort and even time.
I especially don't understand why Javascript doesn't have a "modern" mode where `var` and `==` are banned, prototypes are immutable, etc. You can do all that with linters but the people that need help with that stuff don't know how to set up a linter in the first place or what options to choose.
Then how would they know how to enable "modern" mode? Junior devs shouldn't be setting up any of that stuff anyway, they should be given a laptop with VSCode + prettier already installed, and all of the config they need should be in the project repo.
Most Javascript beginners do not already have a Javascript programming job.
Sure, he did it mostly by being in the right place at the right time. But lots of geniuses tried to do web programmability before, eg with java applets. They were in the right place at the right time too. They spent man years getting it all right, and even Eich’s very first 10-day hacked version of JS (or, well, LiveScript) was better. Don’t dismiss all the stuff he got right. It’s a lot!
# a.mjs
(()=>{
a = 1
})();
# in a shell
$ node a.mjs
ReferenceError: a is not definedhttps://en.wikipedia.org/wiki/ECMAScript_version_history#ES2...
AFAIK core javascript works exactly like 25 years ago, and they haven't changed anything on it, not removing a single keyword or altering a semantics of any less used function, so your 25 years old javascript programs can still run in modern browsers.
<script scr=...>
And in the .js file: var x = 5. That x is global.