I agree with your two first paragraphs. I want to share some elements to complete your outlook.
Javascript, despite having monopoly on the client side since 2007, only saw its usage exploded with Node and NPM around 2013. Java applets and Flash were long dead by then. So it seems that JS success is only partially correlated to its hard-won monopoly on the client side. My intuition is that JS ecosystem cannot be that bad and win so many hearts. Using your words, it seems JS won based on some merits.
A few others clues: Hot reloading, fast build time, good debugging and profiling tools, lots of packages, plenty of already answered problems on stackoverflow/github, progressive complexity, multiple approaches possible from FP to OOP, particular attention to the developer experience (error messages, colors...), good set of linting tools with Typescript or Flow, easy to deploy/deliver, works to make desktop/mobile/web/VR apps, customizable build accessible to mortals, good enough package manager, evolving language that understood that it can always do better, welcoming and accessible dev community, mature networking APIs, good runtimes implemented by different companies...