Earlier quoted context omitted.
That's not really a difficulty of javascript the language - you're supposed to have your javascript completely separate from the HTML and CSS, with everything in static files of that type. Separation of concerns was built into the web from the beginning. It just happens to be a popular architectural pattern at the moment to reimplement the DOM, HTML and CSS all in javascript and have one big mess of code.
You're right that it's not javascript's fault per se. But the rest of your comment represents a narrow, dated and frankly ignorant viewpoint. Component-based front-end architecture has tremendous advantages. And if you want to see "one big mess", simply examine the CSS of virtually any moderately-sized website or web application. I've been doing web-related development since the late 90's, and I make a living as a UI…
It can have both tremendous advantages and be a mess. Both can be, and are, true.