It depends; which version of JavaScript are we talking about here? ES6+ or something out of the medieval pre-ES5 jQuery-plugin-infested dystopia of the early 2000's?
Imagine the web is powered by COBOL :shudders: and JavaScript exists as it does today (the syntax, tooling, and libraries) then it would still be a good tool to solve many problems, so people would use it, even if it didn't run in the browser. Hell, we would probably even have a transpiler named cobel that turned JavaScript into COBOL. But that could never be the case; it's a paradox, a catch-22. JavaScript never could have become what it is today had it not been baked into NetScape ~22 years ago; nobody would have been forced to use it, so it never would have gotten better.
JavaScript is great.... because we had no other choice but to make it great. Prior to ES6, JavaScript was a terrible language and an absolute dread to work with. So you know what? We made it better. Now it's actually my favorite language. ...well TypeScript is, but TypeScript is JavaScript so yeah. Some of greatest weaknesses in the JS of yesteryear have lead to many of the strong features that make the language so dynamic and expressive.
I should also note, that JavaScript is only as good as its community, which according to GitHub stats, is larger and continues to grow more rapidly than any other language by far. The reason why people actually enjoy JavaScript today is the huge amount of awesome shit out there on NPM. If we had ES6+, but still looked to jQuery and friends as cutting-edge, then no, it JavaScript wouldn't be nearly as popular