Blaming JavaScript for the state of the web is like blaming money for greed. JavaScript is only the medium, and the driving force behind it would have created a different language if needed. This take seems too narrow.
What we needed (still need) is a better sandbox for native code. So you can feel as comfortable running some offline app found in some rando's Reddit post as you do clicking on a link from same. Which, in turn, lets untrusted people create interesting new apps without any gatekeepers or barriers to entry.
Right now the same thing happens with the web, but because web browsers are inherently client-server, that creates an implied server dependency and then all of the misfeatures that come with it.
JavaScript failed to take us to a good place because it was not designed to resist corruption. You might make similar arguments about money.
If we went back and replaced those media with less naive designs, I think it's reasonable to believe that they'd take us somewhere different. We are hackers after all, reshaping technology is what we do.
Of course let's also address the lack of scruples that got us here... In fact, let's each do that primarily in our own ways, I'm just saying that this might not be the forum for that.