It was a sunny day, Phineas and Ferb were in their backyard under the only tree when suddenly Phineas asks Ferb.
"Ferb if JavaScript has weird behaviors, is loosely typed, and has so many glitchy stuff in it, then why did it win? Why do all browsers run JavaScript?"
"Actually, JavaScript doesn't run the world, it's ECMAScript."
"What?"
Yeah so you don't know JavaScript because you never questioned, why did browsers chose this lame excuse of a language with it's weird falsy expressions, random floating point arithmetic and loosely typed behavior as their standard?
Let's understand this, shall we?
In 1995, Netscape was the most popular browser and Brendan Eich had created JavaScript so that the browser had the ability to interactivity easily to HTML.
Microsoft seeing this, wanted to do the same and reverse engineered JavaScript to create JScript (copy my homework but don't make it obvious eh?).
This led to browser wars, which were resolved by European Computers Manufacturers Association, by introducing some standards and JavaScript and JScript became dialects of that.
In some form that was the end of JavaScript because this was ECMAScript, ruled and governed by ECMA.
A popular phrasing you may have heard is "var is an ES5 feature and let and const were introduced in ES6". Yeah so you can probably guess what ES here stands for right?
The name JavaScript still kept going on because of ... Java which was believe me when I say it, the most popular language at that time. Actually Netscape wanted to use Java but weren't able to because of its complexity.
JavaScript won because at that time they would accept anything cross platform and easy and it was both of those. Until one day someone (Ryan Dahl) thought what if we used this not in browsers but in the backend and created Node.js.
Not the worst idea, I mean he clearly supports it till date ... oh wait, he doesn't and created Deno that now encourages TypeScript and also has added support for WASM.
Note: This is a raw article, I am not going to reread or edit it, so if you find any faults in it, just create a PR.
Top comments (0)