Which would be fine if you consider JavaScript good, I don't, it's at best passable if you avoid most of the land mines which is an art in and of itself and that's just the language, if you include the ecosystem it's pretty much all landmines.
So, if I take your favorite language and somehow manage to cause its ecosystem to get as bad as you claim Javascript's is, does that mean your favorite language is now bad?
But why did the ecosystem get out of hand so easily? Because the sloppiness of the language encouraged it or made it easy to abuse it. JavaScript's ecosystem is notoriously bad in this respect (cf. with Java or Python or Ruby).
It's sad because that's judging a language based on external things that don't directly relate to the language itself. It's like blaming tools for the misuse of the tools instead of the people actually misusing the tools.