Early adopters of a language tend to be relatively highly skilled and tend to write better code, while when language becomes enormously popular the majority of software written in it tends to revert to the mean.
I'm not sure that principle applies well to JavaScript. It was popular almost from the get-go, being the only language of the Web. A lot of bad practises were popular in the early days.
JavaScript has changed a lot as a language over time -- ECMAScript 2019 makes it a lot easier to write good code than the original JavaScript. It's now better understood how to write JavaScript code, and how not to.