Many people mock Javascript for being bad. Go on any programming forum and you will find countless jokes at the expense of Javascript, but I argue that many of the things people hate most about Javascript were necessary for it to survive. Why is Javascript perceived as bad? To see why this is the case let us first look at the most maligned aspects of Javascript. When I ask people why they hate Javascript, they will say something along the lines of weak typing
I find many of the criticisms of javascript are "why doesn't this language stop me from shooting myself in the foot". These are certainly desirable traits, and they are certainly being remedied in modern times with strict mode in ES6 and typescript. The History of Javascript Looking at the history of Javascript reveals why it must have been this way. It was invented by Brendan Eich in 10 days in 1995, when the web was nothing like it is today. Just imagine how different the web is by looking at a website from 1995 and comparing it to any modern website. Eich, and indeed nobody, could have imagined how the web could have evolved, so planning for the web to change drastically was needed.
The core of my argument is that people want Javascript to be opinionated and strict, when, due to the complex and evolving nature of the web, it is necessary that javascript be flexible and weak. Let's say Javascript took a hard stand and became inflexible on an issue pertaining to the 90s. We today would find that anachronistic and annoying. No central authority can predict how a programming language can be used, so it's better to leave all tools available to the programmer instead of walling off some features for fear that they might be mishandled.