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).