The problem isn't so much with JavaScript as it is with the JavaScript mentality - that is not to say JavaScript doesn't have a ton of problems.
No, the real problem is the mentality of cranking out new frameworks instead of actually building something useful on top of existing ones. Every year, the JS framework of choice changes to something new and you have no choice but to move on because the one you were using until recently has suddenly been dropped as the developers have moved on to the backwards incompatible next version.
And then there is the mentality of writing libraries for the most trivial of tasks - left padding, seriously?